]> Zhao Yanbai Git Server - minix.git/commitdiff
Fixes for absolute path names.
authorBen Gras <ben@minix3.org>
Fri, 17 Mar 2006 12:27:20 +0000 (12:27 +0000)
committerBen Gras <ben@minix3.org>
Fri, 17 Mar 2006 12:27:20 +0000 (12:27 +0000)
commands/scripts/binpackage.sh

index ebcfdabb66459179977f687c80cb47f04ca856ad..a32e30f95d3f3b1984884e2bd48d80ae2714a874 100644 (file)
@@ -19,13 +19,21 @@ then        echo "Error: $dir isn't a directory."
 fi
 
 here=`pwd`
-srcdir=$here/$dir
+
+case "$dir" in
+/*) srcdir="$dir" ;;
+*) srcdir="$here/$dir" ;;
+esac
+
+case $2 in
+/*) pdir="$2" ;;
+*) pdir="$here/$2" ;;
+esac
+
 packagestart=$srcdir/now
 findlist=$srcdir/findlist
-tarfile=${dir}.tar
-tar=$srcdir/$tarfile
+tar=$srcdir/"`basename ${dir}`".tar
 tarbz=$tar.bz
-pdir="$2"
 
 mkdir $pdir 2>/dev/null || true
 binsizes big
@@ -43,5 +51,5 @@ echo " * Building package"
 ( if [ -f $PI ]; then echo $PI; fi; find / -cnewer $packagestart | egrep -v "^($srcdir|/(dev|tmp)|/usr/(tmp|log|adm|run|src)|/etc/utmp|/var/run)" ) | pax -w -d | bzip2 >$tarbz
 rm -f $packagestart $findlist $tarcmd
 binsizes normal
-mv $tarbz $here/$pdir
+mv $tarbz $pdir
 exit 0