JDK-6266743 : Need to update the linux installation script because of new "tail" syntax
  • Type: Bug
  • Component: install
  • Sub-Component: install
  • Affected Version: 1.4.2
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: linux
  • CPU: x86
  • Submitted: 2005-05-06
  • Updated: 2014-02-27
  • Resolved: 2005-12-15
Related Reports
Duplicate :  
Description
FULL PRODUCT VERSION :
java version "1.4.2_08"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_08-b03)
Java HotSpot(TM) Client VM (build 1.4.2_08-b03, mixed mode)


ADDITIONAL OS VERSION INFORMATION :
Linux insano 2.6.11.7 #1 Mon Apr 25 12:39:17 EEST 2005 i686 unknown unknown GNU/Linux (Sorcerer)

A DESCRIPTION OF THE PROBLEM :
With new version of "tail" the syntax has changed

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
just try to install java from .bin onto an updated linux box (coreutils 5.2.1)

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
...
  inflating: j2sdk1.4.2_08/demo/jfc/Stylepad/resources/caterpillar.gif
 extracting: j2sdk1.4.2_08/demo/jfc/Stylepad/resources/center.gif
  inflating: j2sdk1.4.2_08/demo/jfc/Stylepad/resources/fg.gif
  inflating: j2sdk1.4.2_08/demo/jfc/Stylepad/resources/hatter.gif
 extracting: j2sdk1.4.2_08/demo/jfc/Stylepad/resources/italic.gif
 extracting: j2sdk1.4.2_08/demo/jfc/Stylepad/resources/left.gif
 extracting: j2sdk1.4.2_08/demo/jfc/Stylepad/resources/rabbit.gif
  inflating: j2sdk1.4.2_08/demo/jfc/Stylepad/resources/rabbit2.gif
 extracting: j2sdk1.4.2_08/demo/jfc/Stylepad/resources/right.gif
  inflating: j2sdk1.4.2_08/demo/jfc/Stylepad/resources/Stylepad.properties
  inflating: j2sdk1.4.2_08/demo/jfc/Stylepad/resources/Stylepad_sv.properties
  inflating: j2sdk1.4.2_08/demo/jfc/Stylepad/resources/Stylepad_zh_CN.properties
 extracting: j2sdk1.4.2_08/demo/jfc/Stylepad/resources/underline.gif
  inflating: j2sdk1.4.2_08/demo/jfc/Stylepad/resources/Notepad.properties
  inflating: j2sdk1.4.2_08/demo/jfc/Stylepad/resources/Notepad_fr.properties
  inflating: j2sdk1.4.2_08/demo/jfc/Stylepad/resources/Notepad_sv.properties
  inflating: j2sdk1.4.2_08/demo/jfc/Stylepad/resources/Notepad_zh_CN.properties
 extracting: j2sdk1.4.2_08/demo/jfc/Stylepad/resources/copy.gif
 extracting: j2sdk1.4.2_08/demo/jfc/Stylepad/resources/cut.gif
 extracting: j2sdk1.4.2_08/demo/jfc/Stylepad/resources/new.gif
  inflating: j2sdk1.4.2_08/demo/jfc/Stylepad/resources/open.gif
 extracting: j2sdk1.4.2_08/demo/jfc/Stylepad/resources/paste.gif
 extracting: j2sdk1.4.2_08/demo/jfc/Stylepad/resources/save.gif
   creating: j2sdk1.4.2_08/demo/jfc/Stylepad/src/
...
ACTUAL -
(LFI#129530/Form ID#011801)

Do you agree to the above license terms? [yes or no]
yes
tail: `-1' option is obsolete; use `-n 1'
Try `tail --help' for more information.
./j2sdk-1_4_2_08-linux-i586.bin.orig: line 359: [: -lt: unary operator expected
Unpacking...
tail: cannot open `+511' for reading: No such file or directory
Checksumming...
1
The download file appears to be corrupted.  Please refer
to the Troubleshooting section of the Installation
Instructions on the download page for more information.
Please do not attempt to install this archive file.

ERROR MESSAGES/STACK TRACES THAT OCCUR :
tail: `-1' option is obsolete; use `-n 1'
Try `tail --help' for more information.

tail: cannot open `+511' for reading: No such file or directory


REPRODUCIBILITY :
This bug can be reproduced always.

CUSTOMER SUBMITTED WORKAROUND :
--- j2sdk-1_4_2_08-linux-i586.bin.orig  2005-05-05 14:28:08.000000000 +0300
+++ j2sdk-1_4_2_08-linux-i586.bin       2005-05-05 14:34:38.000000000 +0300
@@ -355,7 +355,7 @@
     esac
 done
 outname=install.sfx.$$
-diskSpace=`df -k . | tail -1 | awk '{if ( $4 ~ /%/) { print $3 } else { print $4 } }'`
+diskSpace=`df -k . | tail -n 1 | awk '{if ( $4 ~ /%/) { print $3 } else { print $4 } }'`
 if [ $diskSpace -lt $diskSpaceRequired ]; then
     printf "You will need atleast %s kBytes of Disk Free\n" $diskSpaceRequired
     printf "Please free up the required Disk Space and try again\n"
@@ -363,7 +363,7 @@
 fi
 trap 'rm -f $outname; exit 1' HUP INT QUIT TERM
 echo "Unpacking..."
-tail +511 $0 > $outname
+tail -n +511 $0 > $outname
 if [ -x /usr/bin/sum ] ; then
     echo "Checksumming..."
###@###.### 2005-05-06 20:36:30 GMT

Comments
EVALUATION This bug appears to be a duplicate of 4980600 that was fixed in tiger. ###@###.### 2005-05-11 19:13:42 GMT
11-05-2005