tazpkg rev 9

Basename patch to install path/to/pkgs
author Christophe Lincoln <pankso@slitaz.org>
date Mon Nov 26 21:20:21 2007 +0100 (2007-11-26)
parents 2524f1ab8191
children fa636cb87e98
files tazpkg
line diff
     1.1 --- a/tazpkg	Mon Nov 26 17:07:57 2007 +0100
     1.2 +++ b/tazpkg	Mon Nov 26 21:20:21 2007 +0100
     1.3 @@ -10,7 +10,7 @@
     1.4  # (C) 2007 SliTaz - GNU General Public License v3.
     1.5  # Author : <pankso@slitaz.org>
     1.6  #
     1.7 -VERSION=1.3
     1.8 +VERSION=1.4pre
     1.9  
    1.10  ####################
    1.11  # Script variables #
    1.12 @@ -22,7 +22,8 @@
    1.13  # Initialize some variables to use words
    1.14  # rater than numbers for functions and actions.
    1.15  COMMAND=$1
    1.16 -PACKAGE=${2%.tazpkg}
    1.17 +PACKAGE=$(basename ${2%.tazpkg})
    1.18 +PACKAGE_FILE=$2
    1.19  TARGET_DIR=$3
    1.20  TOP_DIR=`pwd`
    1.21  TMP_DIR=/tmp/tazpkg-$$-$RANDOM
    1.22 @@ -111,13 +112,12 @@
    1.23  	fi
    1.24  }
    1.25  
    1.26 -# Check if the package (*.tazpkg) is in current dir.
    1.27 +# Check if the package (*.tazpkg) exist before installing or extracting.
    1.28  check_for_package_file()
    1.29  {
    1.30 -	if [ ! -f "$TOP_DIR/$PACKAGE.tazpkg" ]; then
    1.31 +	if [ ! -f "$PACKAGE_FILE" ]; then
    1.32  		echo -e "
    1.33 -Unable to find : $TOP_DIR/$PACKAGE.tazpkg
    1.34 -You must be in the package directory to install, extract or pack.\n"
    1.35 +Unable to find : $PACKAGE_FILE\n"
    1.36  		exit 0
    1.37  	fi
    1.38  }
    1.39 @@ -184,7 +184,7 @@
    1.40  	echo -e "\033[1mInstallation of :\033[0m $PACKAGE"
    1.41  	echo "================================================================================"
    1.42  	echo -n "Copying $PACKAGE... "
    1.43 -	cp $PACKAGE.tazpkg $TMP_DIR
    1.44 +	cp $PACKAGE_FILE $TMP_DIR
    1.45  	status
    1.46  	cd $TMP_DIR
    1.47  	extract_package
    1.48 @@ -568,7 +568,7 @@
    1.49  		fi
    1.50  		mkdir -p $DESTDIR
    1.51  		echo -n "Copying original package..."
    1.52 -		cp $PACKAGE.tazpkg $DESTDIR
    1.53 +		cp $PACKAGE_FILE $DESTDIR
    1.54  		status
    1.55  		cd $DESTDIR
    1.56  		extract_package