]> Zhao Yanbai Git Server - minix.git/commitdiff
use smallbunzip only when we can't start bunzip
authorBen Gras <ben@minix3.org>
Tue, 4 Apr 2006 14:52:22 +0000 (14:52 +0000)
committerBen Gras <ben@minix3.org>
Tue, 4 Apr 2006 14:52:22 +0000 (14:52 +0000)
commands/scripts/packit.sh
commands/scripts/packman.sh

index b9f644eaf20fddb0013fafd4c925bd671ba1b5d4..3d52c94a128e49d3785f827f76e3e5b56ba29f92 100644 (file)
@@ -32,7 +32,13 @@ then echo "Couldn't find package $f."
        exit 1
 fi
 
-cat $f | smallbunzip2 | pax -r -p e
+# can we execute bunzip2?
+if bunzip2 --help 2>&1 | grep usage >/dev/null
+then   BUNZIP2=bunzip2
+else   BUNZIP2=smallbunzip2
+fi
+
+cat $f | $BUNZIP2 | pax -r -p e
 if [ -f $PI ]
 then
        sh -e $PI
index 60be7be0c650af175de7bea7eab44291ec4ca841..f2c6bdca5353cde01b72cdda6e716ba7444019cc 100644 (file)
@@ -15,6 +15,12 @@ URL2=http://www.minix3.org/beta_packages
 SRCURL1=http://www.minix3.org/software
 SRCURL2=http://www.minix3.org/beta_software
 
+# can we execute bunzip2?
+if bunzip2 --help 2>&1 | grep usage >/dev/null
+then    BUNZIP2=bunzip2 
+else    BUNZIP2=smallbunzip2
+fi
+
 if id | fgrep "uid=0(" >/dev/null
 then   :
 else   echo "Please run $0 as root."
@@ -89,7 +95,7 @@ else  cont=y
                                echo " * Installing sources in $SRC .."
                                for f in $CDSRC/*.tar.bz2
                                do      echo "$f .."
-                                       smallbunzip2 -dc $f | tar xf - 
+                                       $BUNZIP2 -dc $f | tar xf - 
                                done
                        fi
                        ;;
@@ -199,7 +205,7 @@ do  cd $TMPDIR
                                        echo "Retrieving source from $srcurl .."
                                        urlget $srcurl >$srcfile || exit
                                        echo "Source retrieved in $SRC/$srcfile."
-                                       smallbunzip2 -dc $srcfile | tar xf - >/dev/null || exit
+                                       $BUNZIP2 -dc $srcfile | tar xf - >/dev/null || exit
                                        echo "Source unpacked in $SRC."
                                )
                        fi
@@ -217,7 +223,7 @@ do  cd $TMPDIR
                                read src
                                if [ "$src" = y -o "$src" = Y ]
                                then    (       cd $SRC || exit
-                                               smallbunzip2 -dc $srcfile | tar xf - || exit
+                                               $BUNZIP2 -dc $srcfile | tar xf - || exit
                                                echo "Source $srcfile unpacked in $SRC."
                                        )
                                fi