home *** CD-ROM | disk | FTP | other *** search
/ Big Green CD 8 / BGCD_8_Dev.iso / NEXTSTEP / UNIX / Utilities / gzip_package / gzip_package.sh < prev    next >
Encoding:
Linux/UNIX/POSIX Shell Script  |  1998-03-04  |  17.1 KB  |  630 lines

  1. #!/bin/sh
  2. #+++
  3. # RCS $Id: gzip_package.sh,v 2.7 1998/03/04 19:53:50 tom Exp $
  4. # title:    gzip_package
  5. # abstract:    convert NS Installer.app package to use gzipped archive.
  6. # author:    T.R.Hageman <tom@basil.icce.rug.nl>
  7. # created:    September 1994
  8. # modified:    (see RCS Log at end)
  9. # copyleft:
  10. #
  11. #        Copyright (C) 1994--1998  Tom R. Hageman.
  12. #
  13. #    This is free software; you can redistribute it and/or modify
  14. #    it under the terms of the GNU General Public License as published by
  15. #    the Free Software Foundation; either version 2 of the License, or
  16. #    (at your option) any later version.
  17. #
  18. #    This software is distributed in the hope that it will be useful,
  19. #    but WITHOUT ANY WARRANTY; without even the implied warranty of
  20. #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  21. #    GNU General Public License for more details.
  22. #
  23. #    You should have received a copy of the GNU General Public License
  24. #    along with this software; if not, write to the Free Software
  25. #    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  26. #
  27. # description:
  28. #
  29. #---
  30.  
  31. Revision=; Date=
  32. Clean() { expr "$1" : ':* *\(.*[^ $]\) *$*'; }
  33.  
  34. Revision=`Clean "$Revision: 2.7 $"`
  35. Date=`Clean "$Date: 1998/03/04 19:53:50 $"`
  36.  
  37. prog=`basename $0`
  38.  
  39. USAGE="Usage: $prog [options] package...
  40.   -d --debug    Debug mode (don't remove tmp files.)
  41.   -i --info     Show package's compression status.
  42.   -k --keep    Keep original package around.
  43.   -q --quiet    Shut up completely.
  44.   -s --save=*    How much gzip should save at least (in kbytes, or \`nn%'). 
  45.   -u --unzip    Expand gzip'ed package archive to normal (compressed).
  46.   -v --verbose    Talkative mode.
  47.   -h --help    Show help text.
  48.   -V --version    Show version."
  49.  
  50. tar=gnutar
  51.  
  52. verbose=
  53. debug=
  54. keep=
  55. quiet=
  56. unzip=
  57. info=
  58. minsavings="5%"
  59.  
  60. # Determine default action from program name, a la gzip <-> gunzip.
  61. case "$prog" in #(
  62. gunzip*) unzip=yes
  63. esac
  64.  
  65. StdErr() { echo "$@" >&2; }
  66.  
  67. # Handle options.
  68. while true; do
  69. {
  70.     case "$1" in #((((((((((
  71.     -V | --version | --versio | --versi | --vers | --ver | --ve | --v )
  72.     echo $prog Version $Revision of $Date.
  73.     exit 0
  74.     ;;
  75.     -d | --debug | --debu | --deb | --de | --d )
  76.     debug=yes
  77. #    set -x
  78.     shift
  79.     ;;
  80.     -i | --info | --inf | --in | --i )
  81.     info=yes
  82.     shift
  83.     ;;
  84.     -k | --keep | --kee | --ke | --k )
  85.     keep=yes
  86.     shift
  87.     ;;
  88.     -q | --quiet | --quie | --qui | --qu | --q )
  89.     quiet=yes
  90.     verbose=
  91.     shift
  92.     ;;
  93.     -s=* | --save=* | --sav=* | --sa=* | --s=* )
  94.     minsavings=`expr "$1" : '[^=]*=\([0-9][0-9]*%*\)`
  95.     [ "$minsavings" ] ||
  96.     {
  97.         Stderr "$prog: value for \`$1' should be number or percentage."
  98.         exit 2
  99.     }
  100.     shift
  101.     ;;
  102.     -s | --save | --sav | --sa | --s )
  103.     minsavings=`expr "$2" : '\([0-9[0-9]*%*\)'`
  104.     [ "$minsavings" ] ||
  105.     {
  106.         Stderr "$prog: value for \`$1 $2' should be number or percentage."
  107.         exit 2
  108.     }
  109.     shift
  110.     shift
  111.     ;;
  112.     -u | --unzip |--unzi | --unz | --un | --u )
  113.     unzip=yes
  114.     shift
  115.     ;;
  116.     -v | --verbose | --verbos | --verbo | --verb )
  117.     verbose=yes
  118.     quiet=
  119. #    set -v
  120.     shift
  121.     ;;
  122.     -h | --help | --hel | --he | --h )
  123.         echo "$USAGE"
  124.     exit 0
  125.     ;;
  126.     -- )    # option delimiter.
  127.     shift
  128.     break
  129.     ;;
  130.     -* )
  131.     StdErr "$prog: invalid option \`$1'"
  132.     StdErr "$USAGE"
  133.     exit 2
  134.     ;;
  135.     "" )
  136.     case "$#" in #(
  137.     0)  StdErr "$USAGE"
  138.         exit 2
  139.     esac
  140.     # silently ignore empty argument.
  141.     shift
  142.     ;;   
  143.     * )
  144.     break
  145.     ;;
  146.     esac
  147. }
  148. done
  149.  
  150. status=0
  151. tmpprefix="##$prog##"
  152.  
  153. # Error handling.
  154.  
  155. # Unfortunately `continue' does not seem to work from within a shell function,
  156. # So don't forget to add it explicitly after each occurrence of BailOut.
  157. BailOut() { [ "$1" -gt "$status" ] && status=$1; [ "$debug" ] || eval "$onexit"; onexit=; }
  158.  
  159. Error() {
  160.     StdErr "$prog:" "$@"
  161.     BailOut 1
  162. }
  163.  
  164.  
  165. # Support function to yield free space (in kbytes) available in dir.
  166. DiskFreeSpace() {    # $1: <in-directory>
  167.     #                         Available       Capacity
  168.     df "$1" | sed -n 's|^.* \([0-9][0-9]*\)  *[0-9][0-9]% .*|\1|p'
  169. }
  170.  
  171. # Support function to yield size of package.
  172. DirUsage() {        # $1 <in-directory>
  173.     du -s -l "$1" | sed 's:^\([0-9][0-9]*\).*:\1:'
  174. }
  175.  
  176. # Safely remove directory recursively, but only if we own it.
  177. WipeDir() {        # $1: <directory>
  178.    chmod -R u+w "$1" >/dev/null 2>&1 && rm -rf "$1"
  179. }
  180.  
  181. # Function to replace target package with newly-built one.
  182. ReplaceTarget() {
  183.     if [ "$inplace" ]; then
  184.     {
  185.     # in-place is relatively simple.
  186.     backup="$pkgdir~"
  187.     WipeDir "$backup"
  188.     mv "$pkgdir" "$backup" 2>/dev/null ||
  189.         { Error "Cannot move original package to \`$backup'"; return; }
  190.  
  191.     onexit='mv "$backup" "$pkgdir" 2>/dev/null ||
  192.             Stderr "(original package is now named \`$backup'\'')
  193.         '"$onexit"
  194.  
  195.     mv "$builddir" "$pkgdir" 2>/dev/null ||
  196.         { Error "Cannot move new package to \`$pkgdir'"; return; }
  197.  
  198.     onexit=
  199.  
  200.     [ "$keep" ] || onexit='WipeDir "$backup"'
  201.     }
  202.     else
  203.     {
  204.     # Not in-place; either because there was not enough space on the disk,
  205.     # or because the directory in which the package resides is not
  206.     # writeable.  Anyway, it's a lot harder.
  207.  
  208.     # Make backup of package in $HOME.
  209.     suffix=
  210.     while [ "$suffix" != "~~~~~~~~" ]
  211.     do
  212.         backup="$HOME/$pkgname.pkg~$suffix"
  213.         WipeDir "$backup"
  214.         [ ! -d "$backup" -a ! -f "$backup" ] && break
  215.         suffix="$suffix~"
  216.     done
  217.     mkdir "$backup" 2>/dev/null ||
  218.         { Error "Cannot create backup package \`$backup'"; return; }
  219.     ( cd "$pkgdir" && $tar -cf - . ) 2>/dev/null |
  220.         ( cd "$backup" && $tar -xpf - ) 2>/dev/null ||
  221.         { Error "copy to backup package \`$backup' failed."; return; }
  222.  
  223.     onexit='{   WipeDir "$pkgdir/."
  224.             ( cd "$backup" && $tar -cf - . ) 2>/dev/null |
  225.             ( cd "$pkgdir" && $tar -xpf - ) 2>/dev/null
  226.         } || Stderr "(original package is now in \`$backup'\'')
  227.         '"$onexit"
  228.  
  229.     WipeDir "$pkgdir/."
  230.     ( cd "$builddir" && $tar -cf - . ) 2>/dev/null |
  231.         ( cd "$pkgdir" && $tar -xpf - ) 2>/dev/null ||
  232.         { Error "Cannot copy new package to \`$pkgdir'"; return; }
  233.  
  234.     onexit=
  235.     [ "$keep" ] || onexit='WipeDir "$backup"'
  236.     WipeDir "$builddir"
  237.     }
  238.     fi
  239. }
  240.  
  241. # Catch signals.
  242. onexit=
  243. trap '[ "$debug" ] || eval "$onexit"; trap 0; exit $status' 0
  244. trap 'StdErr "***signalled***"; status=2; exit $status' 1 2 3 15
  245.  
  246.  
  247. for arg in "$@"; do
  248.  
  249. # Strip off trailing slashes.
  250. pkgdir=`expr "$arg"  : '\(.*[^/]\)/*'`
  251. shift
  252.  
  253. if [ -d "$pkgdir.pkg" ]; then
  254. {
  255.     pkgdir="$pkgdir.pkg"
  256. }
  257. elif [ ! -d "$pkgdir" ]; then
  258. {
  259.     [ -f "$pkgdir" ] || Error "package \`$pkgdir' does not exist."
  260.     Error "\`$pkgdir' is not a directory."
  261.     continue
  262. }
  263. fi
  264.  
  265. # More sanity checks.
  266. [ "$info" ] || [ -w "$pkgdir" ] || { Error "package \`$pkgdir' is read-only."; continue; }
  267.  
  268. # Get the root of the package, sans .pkg extension.
  269. pkgname=`basename "$pkgdir" .pkg`
  270.  
  271. packagesize=`DirUsage "$pkgdir"`
  272.  
  273. # Load size definitions in *.sizes into shell variables.
  274. CompressedSize=`sed -n 's/^CompressedSize \(.*\)/\1/p' "$pkgdir/$pkgname.sizes"`
  275.  
  276. # Check if this is already gzipped.
  277. if [ -f "$pkgdir/$pkgname.tar.gz" -a -h "$pkgdir/$pkgname.tar.Z" ]
  278. then
  279.     realCompressedSize=`sed -n 's/^realCompressedSize \(.*\)/\1/p' "$pkgdir/$pkgname.sizes"`
  280.     expands=`expr $realCompressedSize - $CompressedSize`
  281.     sizeneeded=`expr $packagesize + $expands`
  282.     if [ "$info" ]
  283.     then
  284.     mesg=
  285.     [ "$verbose" ] && mesg=" [${packagesize} kbytes, saves ${expands} (`expr $expands \* 100 / $sizeneeded`%)]"
  286.     echo "$pkgdir:    gzipped$mesg"
  287.     BailOut 0; continue
  288.     else
  289.     [ "$unzip" ] || {
  290.         [ "$quiet" ] || StdErr "$prog: \`$pkgdir' is already gzipped; unchanged"
  291.         BailOut 0; continue
  292.     }
  293.     fi
  294. else
  295.     if [ "$info" ]
  296.     then
  297.     if [ -f "$pkgdir/$pkgname.tar.Z" ]
  298.     then
  299.         mesg=compressed
  300.         [ "$verbose" ] && mesg="$mesg [${packagesize} kbytes]"
  301.     else
  302.         mesg=installed
  303.         [ "$verbose" ] && mesg="$mesg [at "`cat "$pkgdir/$pkgname.location"`"]"
  304.     fi
  305.     echo "$pkgdir:    $mesg"
  306.     BailOut 0; continue
  307.     else
  308.     [ "$unzip" ] && {
  309.         [ "$quiet" ] || StdErr "$prog: \`$pkgdir' is already gunzipped; unchanged"
  310.         BailOut 0; continue
  311.     }
  312.     fi
  313.     sizeneeded=$packagesize
  314. fi
  315.  
  316. # Get the directory in which the package resides.
  317. unset parentdir
  318. [ "${parentdir=`expr \"$pkgdir\" : '\(.*\)/[^/][^/]*'`}" ] || parentdir="."
  319.  
  320. [ "$quiet" -o "$verbose" ] || echo -n "$pkgdir:    "
  321.  
  322.  
  323. # We need a temporary work directory which will contain the updated package.
  324. # See where we can create it.
  325.  
  326. inplace=
  327. # overestimate size about 10 percent to be on the safe side...
  328. [ `expr $sizeneeded \* 11 / 10` -le `DiskFreeSpace "$parentdir"` ] &&
  329. {
  330.     inplace=yes
  331.     builddir="$parentdir/$tmpprefix$$"
  332.     mkdir "$builddir" 2>/dev/null || inplace=
  333.     # If this fails, this is probably due to parent-dir being write-protected,
  334.     # so build the new package in /tmp instead
  335. }
  336. [ "$inplace" ] ||
  337. {
  338.     builddir="/tmp/$tmpprefix$$"
  339.     mkdir "$builddir" 2>/dev/null ||
  340.     { Error "Cannot create build-directory for \`$pkgdir'."; continue; }
  341. }
  342.  
  343. # Cleanup.
  344. onexit="WipeDir \"$builddir\""
  345.  
  346.  
  347. # Transfer the contents of the original package, except the archive
  348. ( cd "$pkgdir" && $tar -cf - `ls -A | fgrep -v "\
  349. $pkgname.tar.Z
  350. $pkgname.tar.gz"` ) 2>/dev/null |
  351.     ( cd "$builddir" && $tar -xpf - ) 2>/dev/null ||
  352.     { Error "copy to build-directory of \`$pkgdir' failed."; continue; }
  353.  
  354. if [ "$unzip" ]
  355. then
  356.     # Handle gzipped -> compressed package 
  357.  
  358.     # Remove the symbolic .Z link and other junk stuff.
  359.     rm -f $builddir/$pkgname.tar.Z $builddir/funzip
  360.  
  361.     # Restore original values in *.sizes
  362.     sed 's/^\(CompressedSize\).*/\1 '"$realCompressedSize"'/
  363.      /^realCompressedSize/d' "$builddir/$pkgname.sizes" >"$builddir/real_sizes"
  364.  
  365.     # Move the real scripts back.
  366.     for i in pre_install post_install sizes; do
  367.     {
  368.     rm -f "$builddir/$pkgname.$i"
  369.     [ -f "$builddir/real_$i" ] &&
  370.     {
  371.         mv "$builddir/real_$i" "$builddir/$pkgname.$i" 2>/dev/null ||
  372.         { Error "Cannot move $i script for \`$pkgdir'."; continue 2; }
  373.     }
  374.     }
  375.     done
  376.  
  377.     # Now re-expand the contents of the package using compress.
  378.     gunzip < "$pkgdir/$pkgname.tar.gz" | compress > "$builddir/$pkgname.tar.Z" ||
  379.     { Error "Cannot re-gunzip contents of \`$pkgdir'."; continue; }
  380.  
  381.     [ "$quiet" ] ||
  382.     {
  383.     [ "$verbose" ] && echo -n "$pkgdir: "
  384.     echo "expands $expands kbytes (`expr $expands \* 100 / $packagesize`%)"
  385.     }
  386.  
  387.     # Now, finally, replace the target package with the compressed one.
  388.     ReplaceTarget
  389.  
  390.     BailOut 0; continue
  391. fi
  392.  
  393. # Handle compressed -> gzipped package
  394.  
  395. # Now recompress the contents of the package using gzip.
  396. gunzip < "$pkgdir/$pkgname.tar.Z" | gzip -9 > "$builddir/$pkgname.tar.gz" ||
  397.     { Error "Cannot re-gzip contents of \`$pkgdir'."; continue; }
  398.  
  399. # Copy a tiny ungzipper (funzip [m68k]) to the new package,
  400. # for NS < 3.1 compatibility.
  401. (cd $builddir; sed -n '/^begin .* funzip/,/^end/p' | uudecode) <"$0" ||
  402.     { Error "Cannot add funzip to \`$pkgdir'."; continue; }
  403.  
  404. # Create a symbolic link to a temporary location for the original contents.
  405. ln -s "/tmp/$tmpprefix$pkgname.tar.Z" "$builddir/$pkgname.tar.Z" ||
  406.     { Error "cannot create symbolic link for \`$pkgname.tar.Z"; continue; }
  407.  
  408.  
  409. # Now add a pre_install script to unpack the .gz archive to the temp. location,
  410. # and a post_install script to do the necessary cleanup.
  411.  
  412. # Move the real scripts out of the way.
  413. for i in pre_install post_install sizes; do
  414. {
  415.     [ -f "$builddir/$pkgname.$i" ] &&
  416.     {
  417.     mv "$builddir/$pkgname.$i" "$builddir/real_$i" 2>/dev/null ||
  418.         { Error "Cannot move $i script for \`$pkgdir'."; continue 2; }
  419.     }
  420. }
  421. done
  422.  
  423. # Now create replacement scripts.
  424.  
  425. SUBSTS='1i\
  426. #!/bin/sh\
  427. # AUTOMATICALLY GENERATED BY '"$prog $Revision of $Date"'.\
  428. \
  429. d="$1"\
  430. n=`basename "$d" .pkg`\
  431. p="$d/$n"\
  432. t="/tmp/'"$tmpprefix"'$n.tar.Z"
  433. '
  434. #NO#/^[     ]*#/d'
  435. #NO## (Remove comment lines to keep the installed scripts lean.)
  436.  
  437. sed "$SUBSTS" >"$builddir/$pkgname.pre_install" <<\!!!pre
  438. r="$d/real_pre_install"
  439. E=echo
  440. B='[ -f "$r" ] && exec "$r" "$@"; $E OK.'
  441.  
  442. # Bail out if there is no gzipped archive. (assume regular package)
  443. [ -f "$p.tar.gz" ] || eval "$B"
  444.  
  445. # Make sure symlink to work file is in place.
  446. [ -h "$p.tar.Z" ] || {
  447.     # No link. Bail out if looks like regular package after all.
  448.     [ -f "$p.tar.Z" ] && eval "$B"
  449.     # Last-ditch effort: try to create link.
  450.     ln -s "$t" "$p.tar.Z" || { $E FAILED.; exit 1; }
  451. }
  452. # Execute real pre_install script, if it exists, first.
  453. [ -r "$r" ] && { "$r" "$@" || exit 1; } || $E
  454.  
  455. # Remove work file for good measure.
  456. rm -f "$t"
  457.  
  458. $E -n "    Gunzipping package ... "
  459. # Try resident gunzip first; if this fails try ungzipper in package.
  460. for u in gunzip "$d/funzip" "$d/gunzip";do
  461.     e=`("$u" <"$p.tar.gz" | compress -f >"$p.tar.Z")2>&1`
  462.     [ -z "$e" ] && break
  463. done
  464. [ -z "$e" ] || { $E "FAILED -- $e."; exit 1; }
  465.  
  466. $E OK.
  467. !!!pre
  468.  
  469. sed "$SUBSTS" >"$builddir/$pkgname.post_install" <<\!!!post
  470.  
  471. # Determine working directory used by Installer.
  472. # (Its contents are copied to /NextLibrary/Receipts)
  473. wd=`echo "$0"|sed 's:[^/]*$::;s://*$::'`
  474. case "$wd" in #((
  475. /tmp/*|/private/tmp/*) ;;
  476. *) wd=/tmp
  477. esac
  478. wp="$wd/$n"
  479.  
  480. # Go cleanup the temporary compressed archive.
  481. rm -f "$t"
  482.  
  483. size=`sed -n 's/^realCompressedSize \(.*\)/\1/p' "$wp.sizes" 2>/dev/null`
  484. [ -n "$size" ] && {
  485.     rm -f "$wp.sizes"
  486.  
  487.     # Restore original values in *.sizes
  488.     sed 's/^\(CompressedSize\).*/\1 '"$size"'/
  489.              /^realCompressedSize/d' "$p.sizes" >"$wp.sizes"
  490. }
  491.  
  492. # Replace gzip_package pre_ and post_install with the real scripts.
  493. for i in pre_install post_install
  494. do
  495.     rm -f "$wp.$i"
  496.     [ -f "$d/real_$i" ] && cp -p "$d/real_$i" "$wp.$i"
  497. done
  498.  
  499. # Now continue with the real post_install script if there is any.
  500. [ -f "$wp.post_install" ] && exec "$wp.post_install" "$@"
  501.  
  502. echo OK.
  503. !!!post
  504.  
  505. chmod 555 "$builddir/$pkgname.pre_install" "$builddir/$pkgname.post_install"
  506.  
  507. # We're finished building the gzipped package.
  508.  
  509. # Check if it's worth replacing the original package with it.
  510. gzpackagesize=`DirUsage "$builddir"`
  511.  
  512. case "$minsavings" in #(((
  513. [0-9]% | [1-9][0-9]% )
  514.     i=`expr $minsavings : '\(.*\)%'`
  515.     scaledpackagesize=`expr \( 100 - $i \) \* $packagesize / 100`
  516.     ;;
  517. 0 | "" )
  518.     scaledpackagesize=$packagesize
  519.     ;;
  520. * )
  521.     scaledpackagesize=`expr $packagesize - $minsavings`
  522. esac
  523.  
  524. saves=`expr $packagesize - $gzpackagesize`
  525. case "$saves" in #((
  526. -*)
  527.     expands=`expr "$saves" : "-\(.*\)"`
  528.     mesg="would expand $expands kbytes (`expr $expands \* 100 / $packagesize`%)"
  529.     ;;
  530. *)
  531.     mesg=" $saves kbytes (`expr $saves \* 100 / $packagesize`%)"
  532.     if [ $gzpackagesize -lt $scaledpackagesize ]; then
  533.     mesg="saves $mesg"
  534.     else
  535.     mesg="would save $mesg, if not for --save=$minsavings"
  536.     fi
  537. esac
  538.  
  539. [ "$quiet" ] ||
  540. {
  541.     [ "$verbose" ] && echo -n "$pkgdir: "
  542.     echo "$mesg"
  543. }
  544.     
  545. [ $gzpackagesize -lt $scaledpackagesize ] ||
  546.     { BailOut 0; continue; }
  547.  
  548. # Update *.sizes, store original CompressedSize with key `realCompressedSize'
  549. sed 's/^\(CompressedSize\).*/\1 '`expr $CompressedSize - $saves`'/
  550.      $a\
  551. realCompressedSize '$CompressedSize \
  552.     "$builddir/real_sizes" >"$builddir/$pkgname.sizes"
  553. rm -f $builddir/real_sizes
  554.  
  555. # Now, finally, replace the target package with the gzipped one.
  556. ReplaceTarget
  557.  
  558. BailOut 0
  559.  
  560. done
  561.  
  562. exit $status
  563.  
  564. #======================================================================
  565. # $Log: gzip_package.sh,v $
  566. # Revision 2.7  1998/03/04 19:53:50  tom
  567. # (pre_install): bugfix: redirect stderr from gunzip shell into error string
  568. #  so retrying funzip works.
  569. #
  570. # Revision 2.6  1997/11/09 13:35:11  tom
  571. # post_install template: avoid spurious warnings when invoked from outside
  572. # Installer.app.
  573. #
  574. # Revision 2.5  1996/12/21 14:15:52  tom
  575. # (WipeDir): new function; use it instead of rm -rf.
  576. # (BailOut): set status from argument first, to avoid collision with WipeDir in onexit.
  577. # (ReplaceTarget): add -p to extracting tar; errors to /dev/null.
  578. # - some comment fixes; remove obsolete debugging comments.
  579. #
  580. # Revision 2.4  1996/11/15 22:19:15  tom
  581. # (diskFreeSpace): yet another NFS-mount fix.
  582. #
  583. # Revision 2.3  1996/02/28 20:29:45  tom
  584. # (SUBSTS): add trailing newline to make it work with GNU sed v?.??
  585. #  [as reported by Gregor Hoffleit <flight@mathi.uni-heidelberg.de>]
  586. #
  587. # Revision 2.2  1995/12/15 14:32:51  tom
  588. # Added -i, --info option and functionality;
  589. # Fixed bug that crashed gzip_package when the package it worked on
  590. # was located on an NFS-mounted volume.
  591. #
  592. # Revision 2.1  1995/07/31 12:14:59  tom
  593. # Fix bug in package expansion message.
  594. #
  595. # Revision 2.0  1995/07/16 12:01:36  tom
  596. # (options): added -h --help; allow multiple package arguments;
  597. # (pre_install): improved error detection, preserve comments;
  598. # (post_install): preserve comments.
  599. #
  600. # Revision 1.7  1995/03/31  15:11:21  tom
  601. # First public release.
  602. #
  603. # Revision 1.6  1995/01/19  23:10:58  tom
  604. # fix bug in funzip uuextraction.
  605. #
  606. # Revision 1.5  1995/01/01  15:07:24  tom
  607. # rename to gzip_package.sh; extract funzip from uuencoded version appended
  608. # to the final gzip_package script.
  609. #
  610. # Revision 1.4  1994/12/30  20:09:39  tom
  611. # fix typos: s/strip gunzip/strip funzip/; s/work_prefix/workprefix/.
  612. #
  613. # Revision 1.3  1994/12/23  14:18:01  tom
  614. # (USAGE): add -u --unzip option, determine its default value from $0;
  615. # (ReplaceTarget): new function, handles final update of target package;
  616. # adjust *.sizes table to reflect new archive size, store original size with
  617. # realCompressedSize key;  NEW: handle uncompression;
  618. # (proto post_install): carefully restore original package state, i.e., replace
  619. # gzip_package generated *_install scripts with the real ones (if any) in the
  620. # work directory, also restore *.sizes table to its original pre-gzip_packaged
  621. # state.
  622. #
  623. # Revision 1.2  1994/09/23  10:09:05  tom
  624. # hammer out the bugs in installer script prototypes.
  625. #
  626. # Revision 1.1  1994/09/23  08:07:43  tom
  627. # Initial revision
  628. #
  629. #======================================================================
  630.