]> git.sven.stormbind.net Git - sven/java-package.git/commitdiff
Replaced tabs with spaces
authorEmmanuel Bourg <ebourg@apache.org>
Tue, 7 Feb 2012 00:06:07 +0000 (01:06 +0100)
committerCédric Pineau <cedric.pineau@gmail.com>
Thu, 2 Aug 2012 16:23:59 +0000 (18:23 +0200)
Signed-off-by: Cédric Pineau <cedric.pineau@gmail.com>
lib/common.sh
lib/j2se.sh
lib/oracle-j2re.sh
lib/oracle-j2sdk-doc.sh
lib/oracle-j2sdk.sh
make-jpkg

index 64f5810b8f9bff9d61c22c2b037bf98da7f5d348..4f9edd48bbd6cfbd3af9aa4a37c2a365e9402d9f 100644 (file)
@@ -2,15 +2,15 @@
 read_yn() {
     local prompt="$1"
     while true; do
-       read -e -n 1 -p "$prompt" reply
-       case "$reply" in
-           "" | "y" | "Y")
-               return 0
-               ;;
-           "N" | "n")
-               return 1
-               ;;
-       esac
+    read -e -n 1 -p "$prompt" reply
+    case "$reply" in
+        "" | "y" | "Y")
+        return 0
+        ;;
+        "N" | "n")
+        return 1
+        ;;
+    esac
     done
 }
 
@@ -27,12 +27,12 @@ diskusage() {
 diskfree() {
     local size="$1"
     echo -n "Checking free diskspace:"
-       (( free = `stat -f -c '%a / 2048 * ( %s / 512 )' $tmp ` ))
+    (( free = `stat -f -c '%a / 2048 * ( %s / 512 )' $tmp ` ))
 
     if [ "$free" -ge "$size" ]; then
-       echo " done."
+    echo " done."
     else
-       cat >&2 << EOF
+    cat >&2 << EOF
 
 
 WARNING: Possibly not enough free disk space in "$tmp".
@@ -45,7 +45,7 @@ Press Ctrl+C to interrupt, or return to try to continue anyway.
 TMPDIR.
 
 EOF
-       read
+    read
     fi
 }
 
@@ -69,23 +69,23 @@ EOF
     mkdir "$extract_dir"
     cd "$extract_dir"
     echo
-
+    
     local extract_cmd
     case "$archive_path" in
-       *.tar)
-           extract_cmd="tar xf";;
-       *.tar.bz2)
-           extract_cmd="tar --bzip2 -xf";;
-       *.tgz|*.tar.gz)
-           extract_cmd="tar xfz";;
-       *.zip)
-           extract_cmd="unzip -q";;
-       *)
-           extract_cmd=sh
+    *.tar)
+        extract_cmd="tar xf";;
+    *.tar.bz2)
+        extract_cmd="tar --bzip2 -xf";;
+    *.tgz|*.tar.gz)
+        extract_cmd="tar xfz";;
+    *.zip)
+        extract_cmd="unzip -q";;
+    *)
+        extract_cmd=sh
     esac
-
+    
     if ! $extract_cmd "$archive_path"; then
-       cat << EOF
+    cat << EOF
 
 WARNING: The package installation script exited with an error
 value. Usually, this means, that the installation failed for some
@@ -96,13 +96,13 @@ Please check if there are any error messages. Press [Return] to
 continue or Ctrl-C to abort.
 
 EOF
-       read
+    read
     fi
     echo
     echo -n "Testing extracted archive..."
     local size="$( diskusage "$extract_dir" )"
     if [ "$size" -lt "$expected_min_size" ]; then
-       cat << EOF
+    cat << EOF
 
 Invalid size ($size MB) of extracted archive. Probably you have not
 enough free disc space in the temporary directory. Note: You can
@@ -110,73 +110,73 @@ specify an alternate directory by setting the environment variable
 TMPDIR.
 
 EOF
-       error_exit
+    error_exit
     else
-       cd "$extract_dir"
-       files=(*)
-       if [ "${#files[*]}" -ne 1 ]; then
-           cat << EOF
+    cd "$extract_dir"
+    files=(*)
+    if [ "${#files[*]}" -ne 1 ]; then
+        cat << EOF
 
 Expected one file, but found the following ${#files[*]} files:
     ${files[*]}
 
 EOF
-           error_exit
-       fi
-       mv "$files" "$dest"
-       echo -e " okay.\n"
+        error_exit
+    fi
+    mv "$files" "$dest"
+    echo -e " okay.\n"
     fi
 }
 
 
 read_maintainer_info() {
     if [ -z "$maintainer_name" ]; then
-       if [ -n "$DEBFULLNAME" ]; then
-               maintainer_name="$DEBFULLNAME"
-       elif [ -n "$DEBNAME" ]; then
-               maintainer_name="$DEBNAME"
-       else
-               default_name="$(getent passwd $(id -run) | cut -d: -f5| cut -d, -f1)"
-       
-       cat << EOF
+    if [ -n "$DEBFULLNAME" ]; then
+        maintainer_name="$DEBFULLNAME"
+    elif [ -n "$DEBNAME" ]; then
+        maintainer_name="$DEBNAME"
+    else
+        default_name="$(getent passwd $(id -run) | cut -d: -f5| cut -d, -f1)"
+    
+    cat << EOF
 
 Please enter your full name. This value will be used in the maintainer
 field of the created package.
 
 EOF
 
-       # gecos can be null
-       while [ -z "$maintainer_name" ]; do
-               read -e -p "Full name [$default_name]:" maintainer_name
-               if [ -z "$maintainer_name" ] && [ -n "$default_name" ]; then
-                       maintainer_name="$default_name"
-               fi
-       done
-       fi
+    # gecos can be null
+    while [ -z "$maintainer_name" ]; do
+        read -e -p "Full name [$default_name]:" maintainer_name
+        if [ -z "$maintainer_name" ] && [ -n "$default_name" ]; then
+            maintainer_name="$default_name"
+        fi
+    done
+    fi
     fi
+    
     if [ -z "$maintainer_email" ]; then
-       local default_email=
-       if [ -n "$DEBEMAIL" ]; then
-           maintainer_email="$DEBEMAIL"
-       else 
-       if [ -r "/etc/mailname" ]; then
-           default_email="$( id -run )@$( cat /etc/mailname )"
-       else
-           default_email="$( id -run )@$( hostname --fqdn )"
-       fi
-       cat << EOF
+    local default_email=
+    if [ -n "$DEBEMAIL" ]; then
+        maintainer_email="$DEBEMAIL"
+    else 
+    if [ -r "/etc/mailname" ]; then
+        default_email="$( id -run )@$( cat /etc/mailname )"
+    else
+        default_email="$( id -run )@$( hostname --fqdn )"
+    fi
+    cat << EOF
 
 Please enter a valid email address or press return to accept the
 default value. This address will be used in the maintainer field of
 the created package.
 
 EOF
-       read -e -p "Email [$default_email]: " maintainer_email
-       if [ -z "$maintainer_email" ]; then
-           maintainer_email="$default_email"
-       fi
-       fi
+    read -e -p "Email [$default_email]: " maintainer_email
+    if [ -z "$maintainer_email" ]; then
+        maintainer_email="$default_email"
+    fi
+    fi
     fi
 }
 
index 926060a48fc9ddcb67a1e519006dc77899cf5bf8..cd72d5e3d68b73e54ff8024a8bd76ef9236e9299 100644 (file)
@@ -81,8 +81,8 @@ if [ "\$1" = configure ]; then
         shift
         for program in \$*; do
           update-alternatives \\
-             --install "/usr/bin/\$program" "\$program" "\$program_base/\$program" $j2se_priority \\
-             --slave "/usr/share/man/man1/\$program.1.gz" "\$program.1.gz" "$jvm_base$j2se_name/man/man1/\$program.1.gz"
+          --install "/usr/bin/\$program" "\$program" "\$program_base/\$program" $j2se_priority \\
+          --slave "/usr/share/man/man1/\$program.1.gz" "\$program.1.gz" "$jvm_base$j2se_name/man/man1/\$program.1.gz"
         done
     }
 
index f0c1635f7d2d440e072843979d7009fd05d18ae2..ad398a0f0da439c3434f2990e87f353a6c0f1dbb 100644 (file)
@@ -30,33 +30,33 @@ oracle_j2re_detect() {
     fi
 
 
-       cat << EOF
+    cat << EOF
 
 Detected product:
     Java(TM) Runtime Environment (JRE)
     Standard Edition, Version $j2se_release Update $j2se_update
     Oracle(TM)
 EOF
-       if read_yn "Is this correct [Y/n]: "; then
-           j2se_found=true
-           j2se_required_space=$(( $j2se_expected_min_size * 2 + 20 ))
-           j2se_vendor="oracle"
-           j2se_title="Java(TM) JRE, Standard Edition, Oracle(TM)"
+    if read_yn "Is this correct [Y/n]: "; then
+      j2se_found=true
+      j2se_required_space=$(( $j2se_expected_min_size * 2 + 20 ))
+      j2se_vendor="oracle"
+      j2se_title="Java(TM) JRE, Standard Edition, Oracle(TM)"
 
-           j2se_install=oracle_j2re_install
-           j2se_remove=oracle_j2re_remove
-           j2se_jinfo=oracle_j2re_jinfo
-           oracle_jre_bin_hl="java javaws keytool orbd pack200 rmid rmiregistry servertool tnameserv unpack200 policytool"
-           oracle_jre_bin_jre="javaws policytool"
-           oracle_no_man_jre_bin_jre="ControlPanel"
-           oracle_jre_lib_hl="jexec"
-           j2re_run
-       fi
+      j2se_install=oracle_j2re_install
+      j2se_remove=oracle_j2re_remove
+      j2se_jinfo=oracle_j2re_jinfo
+      oracle_jre_bin_hl="java javaws keytool orbd pack200 rmid rmiregistry servertool tnameserv unpack200 policytool"
+      oracle_jre_bin_jre="javaws policytool"
+      oracle_no_man_jre_bin_jre="ControlPanel"
+      oracle_jre_lib_hl="jexec"
+      j2re_run
+    fi
   fi
 }
 
 oracle_j2re_install() {
-       cat << EOF
+    cat << EOF
 if [ ! -e "$jvm_base$j2se_name/debian/info" ]; then
     exit 0
 fi
@@ -73,7 +73,7 @@ EOF
 }
 
 oracle_j2re_remove() {
-       cat << EOF
+    cat << EOF
 if [ ! -e "$jvm_base$j2se_name/debian/info" ]; then
     exit 0
 fi
index 33d27abedb866efef53dd9c5a20a81d1c1c945b4..1bcf07ffe7626aea53e2594945cac7848ff623b0 100644 (file)
@@ -9,37 +9,37 @@ oracle_j2sdk_doc_detect() {
     
     case "$j2se_release" in
     6) # JDK 6
-         j2se_expected_min_size=44 #Mb
-         ;;
-       *) # JDK 7 and higher
-         j2se_expected_min_size=290 #Mb
-         ;;
+      j2se_expected_min_size=44 #Mb
+      ;;
+    *) # JDK 7 and higher
+      j2se_expected_min_size=290 #Mb
+      ;;
     esac
 
-       cat << EOF
+    cat << EOF
 
 Detected product:
     Java(TM) Development Kit (JDK) Documentation
     Standard Edition, Version $j2se_release Update $j2se_update
     Oracle(TM)
 EOF
-       if read_yn "Is this correct [Y/n]: "; then
-           j2se_found=true
-           j2se_required_space=$(( $j2se_expected_min_size * 2 + 20 ))
-           j2se_vendor="oracle"
-           j2se_title="Java(TM) JDK, Standard Edition, Oracle(TM) Documentation"
+    if read_yn "Is this correct [Y/n]: "; then
+      j2se_found=true
+      j2se_required_space=$(( $j2se_expected_min_size * 2 + 20 ))
+      j2se_vendor="oracle"
+      j2se_title="Java(TM) JDK, Standard Edition, Oracle(TM) Documentation"
 
-           j2se_install=oracle_j2sdk_doc_install
-           j2se_remove=oracle_j2sdk_doc_remove
-           j2sdk_doc_run
-       fi
+      j2se_install=oracle_j2sdk_doc_install
+      j2se_remove=oracle_j2sdk_doc_remove
+      j2sdk_doc_run
     fi
+  fi
 }
 
 j2se_detect_j2sdk_doc_oracle=oracle_j2sdk_doc_detect
 
 oracle_j2sdk_doc_install() {
-       cat << EOF
+    cat << EOF
 if [ ! -e "$javadoc_base$j2se_name" ]; then
     exit 0
 fi
@@ -54,7 +54,7 @@ EOF
 }
 
 oracle_j2sdk_doc_remove() {
-       cat << EOF
+    cat << EOF
 if [ ! -e "$javadoc_base$j2se_name" ]; then
     exit 0
 fi
index b3df6c9646a2b2b5082f025ae24b720386d52746..8c10b594dbd035fdad20e9b75a29829a4f963674 100644 (file)
@@ -37,27 +37,27 @@ Detected product:
     Standard Edition, Version $j2se_release Update $j2se_update
     Oracle(TM)
 EOF
-       if read_yn "Is this correct [Y/n]: "; then
-               j2se_found=true
-               j2se_required_space=$(( $j2se_expected_min_size * 2 + 20 ))
-               j2se_vendor="oracle"
-               j2se_title="Java(TM) JDK, Standard Edition, Oracle(TM)"
+    if read_yn "Is this correct [Y/n]: "; then
+      j2se_found=true
+      j2se_required_space=$(( $j2se_expected_min_size * 2 + 20 ))
+      j2se_vendor="oracle"
+      j2se_title="Java(TM) JDK, Standard Edition, Oracle(TM)"
 
-               j2se_install=oracle_j2sdk_install
-               j2se_remove=oracle_j2sdk_remove
-               j2se_jinfo=oracle_j2sdk_jinfo
-               oracle_jre_bin_hl="java javaws keytool orbd pack200 rmid rmiregistry servertool tnameserv unpack200 policytool"
-               oracle_jre_bin_jre="javaws policytool"
-               oracle_no_man_jre_bin_jre="ControlPanel"
-               oracle_jre_lib_hl="jexec"
-               oracle_bin_jdk="appletviewer extcheck idlj jar jarsigner javac javadoc javah javap jconsole jdb jinfo jmap jps jsadebugd jstack jstat jstatd native2ascii rmic serialver"
-               j2sdk_run
-       fi
+      j2se_install=oracle_j2sdk_install
+      j2se_remove=oracle_j2sdk_remove
+      j2se_jinfo=oracle_j2sdk_jinfo
+      oracle_jre_bin_hl="java javaws keytool orbd pack200 rmid rmiregistry servertool tnameserv unpack200 policytool"
+      oracle_jre_bin_jre="javaws policytool"
+      oracle_no_man_jre_bin_jre="ControlPanel"
+      oracle_jre_lib_hl="jexec"
+      oracle_bin_jdk="appletviewer extcheck idlj jar jarsigner javac javadoc javah javap jconsole jdb jinfo jmap jps jsadebugd jstack jstat jstatd native2ascii rmic serialver"
+      j2sdk_run
+    fi
   fi
 }
 
 oracle_j2sdk_install() {
-       cat << EOF
+    cat << EOF
 if [ ! -e "$jvm_base$j2se_name/debian/info" ]; then
     exit 0
 fi
@@ -75,7 +75,7 @@ EOF
 }
 
 oracle_j2sdk_remove() {
-       cat << EOF
+    cat << EOF
 if [ ! -e "$jvm_base$j2se_name/debian/info" ]; then
     exit 0
 fi
index 74c743b21bdcde85c6d9e3fe817e434f391fe968..41899db7a342d44f64d24cee99846b602abceae0 100755 (executable)
--- a/make-jpkg
+++ b/make-jpkg
@@ -40,31 +40,31 @@ if ! dh_testroot >/dev/null 2>&1; then
         echo "Internal error, fakeroot seems to fail faking root" >&2
         exit 1
     fi
-       exec fakeroot "$0" "$@"
+    exec fakeroot "$0" "$@"
 fi
 
 # check whether I'm real root, and bail out if so... ugly, but needed
 if touch /lib/.test 2>/dev/null; then
-       rm -f /lib/.test
-       echo "You are real root -- unfortunately, some Java distributions have" >&2
-       echo "install scripts that directly manipulate /etc, and may cause some" >&2
-       echo "inconsistencies on your system. Instead, you should become a" >&2
-       echo "non-root user and run:" >&2
-       echo >&2
-       echo "fakeroot make-jpkg $@" >&2
-       echo >&2
-       echo "which will allow no damage to be done to your system files and" >&2
-       echo "still permit the Java distribution to successfully extract." >&2
-       echo >&2
-       echo "Aborting." >&2
-       exit 1
+    rm -f /lib/.test
+    echo "You are real root -- unfortunately, some Java distributions have" >&2
+    echo "install scripts that directly manipulate /etc, and may cause some" >&2
+    echo "inconsistencies on your system. Instead, you should become a" >&2
+    echo "non-root user and run:" >&2
+    echo >&2
+    echo "fakeroot make-jpkg $@" >&2
+    echo >&2
+    echo "which will allow no damage to be done to your system files and" >&2
+    echo "still permit the Java distribution to successfully extract." >&2
+    echo >&2
+    echo "Aborting." >&2
+    exit 1
 fi
 
 
 ### Parse options
 
 print_usage() {
-       cat << EOF
+    cat << EOF
 Usage: $program_name [OPTION]... FILE
 
 $program_name builds a Debian package from the given Java binary distribution FILE
@@ -108,27 +108,27 @@ EOF
 # options
 while [[ $# -gt 0 && "x$1" == x--* ]]; do
     if [[ "x$1" == x--version ]]; then
-       echo "make-jpkg $version"
-       exit 0
+    echo "make-jpkg $version"
+    exit 0
     elif [[ "x$1" == x--help ]]; then
-       print_usage
-       exit 0
+    print_usage
+    exit 0
     elif [[ "x$1" == x--full-name ]]; then
-       [ $# -le 1 ] && missing_argument "$1"
-       shift
-       maintainer_name="$1"
+    [ $# -le 1 ] && missing_argument "$1"
+    shift
+    maintainer_name="$1"
     elif [[ "x$1" == x--email ]]; then
-       [ $# -le 1 ] && missing_argument "$1"
-       shift
-       maintainer_email="$1"
+    [ $# -le 1 ] && missing_argument "$1"
+    shift
+    maintainer_email="$1"
     elif [[ "x$1" == x--revision ]]; then
-       [ $# -le 1 ] && missing_argument "$1"
-       shift
-       revision="-${1}"
+    [ $# -le 1 ] && missing_argument "$1"
+    shift
+    revision="-${1}"
     elif [[ "x$1" == x--changes ]]; then
-       genchanges="true"
+    genchanges="true"
     else
-       unrecognized_option "$1"
+    unrecognized_option "$1"
     fi
     shift
 done
@@ -166,7 +166,7 @@ tmp=
 on_exit() {
     lastcmd="$_"
     if [[ -z "$success" && -z "$failed" ]]; then
-       cat >&2 << EOF
+    cat >&2 << EOF
 
 Aborted ($lastcmd).
 
@@ -174,9 +174,9 @@ EOF
     fi
     # remove temporary directory
     if [ -n "$tmp" -a -d "$tmp" ]; then
-       echo -n "Removing temporary directory: "
-       rm -rf "$tmp"
-       echo "done"
+    echo -n "Removing temporary directory: "
+    rm -rf "$tmp"
+    echo "done"
     fi
 }
 trap on_exit EXIT
@@ -226,7 +226,7 @@ j2se_found=
 for var in ${!j2se_detect_*}; do 
     eval "\$$var"
     if [[ "$j2se_found" == "true" ]]; then
-       break;
+    break;
     fi
 done
 echo