tazpkg rev 96

Allow A-Z for version first letter (lshw)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Mon May 19 21:32:24 2008 +0000 (2008-05-19)
parents c333d478954b
children be31f9fb294a
files tazpkg
line diff
     1.1 --- a/tazpkg	Mon May 19 21:19:49 2008 +0000
     1.2 +++ b/tazpkg	Mon May 19 21:32:24 2008 +0000
     1.3 @@ -172,7 +172,7 @@
     1.4  # Check if a package is already installed.
     1.5  check_for_installed_package()
     1.6  {
     1.7 -	if [ -d "$INSTALLED/${PACKAGE%-[0-9]*}" ]; then
     1.8 +	if [ -d "$INSTALLED/${PACKAGE%-[0-9A-Z]*}" ]; then
     1.9  		echo -e "
    1.10  $PACKAGE is already installed. You can use the --forced option to force
    1.11  installation or remove it and reinstall.\n"
    1.12 @@ -200,8 +200,8 @@
    1.13  # package basename.
    1.14  check_for_package_in_list()
    1.15  {
    1.16 -	if grep -q "^$PACKAGE-[0-9]" $LOCALSTATE/packages.list; then
    1.17 -		PACKAGE=`grep ^$PACKAGE-[0-9] $LOCALSTATE/packages.list`
    1.18 +	if grep -q "^$PACKAGE-[0-9A-Z]" $LOCALSTATE/packages.list; then
    1.19 +		PACKAGE=`grep ^$PACKAGE-[0-9A-Z] $LOCALSTATE/packages.list`
    1.20  	else
    1.21  		echo -e "\nUnable to find : $PACKAGE in the mirrored packages list.\n"
    1.22  		exit 0
    1.23 @@ -248,7 +248,7 @@
    1.24  	. $PWD/receipt
    1.25  	if [ $SELF_INSTALL -ne 0 -a -n "$ROOT" ]; then
    1.26  		echo -n "Checking post install dependencies... "
    1.27 -		[ -d "$INSTALLED/${PACKAGE%-[0-9]*}" ]
    1.28 +		[ -d "$INSTALLED/${PACKAGE%-[0-9A-Z]*}" ]
    1.29  		if ! status; then
    1.30  			echo "Please run 'tazpkg install $PACKAGE_FILE' and retry."
    1.31  			cd .. && rm -rf $TMP_DIR
    1.32 @@ -334,7 +334,7 @@
    1.33  				# the TAZPKG_BASENAME in the local packages.list.
    1.34  				if [ -f "$TOP_DIR/packages.list" ]; then
    1.35  					echo "Checking if $pkg exist in local list... "
    1.36 -					TAZPKG_BASENAME=`grep -e ^$pkg-[0-9] $TOP_DIR/packages.list`
    1.37 +					TAZPKG_BASENAME=`grep -e ^$pkg-[0-9A-Z] $TOP_DIR/packages.list`
    1.38  					if [ -f "$TAZPKG_BASENAME.tazpkg" ]; then
    1.39  						tazpkg install $TAZPKG_BASENAME.tazpkg
    1.40  					fi
    1.41 @@ -1124,9 +1124,9 @@
    1.42  			else
    1.43  				# Check if the installed package is in the current list (other
    1.44  				# mirror or local).
    1.45 -				if grep -q "^$PACKAGE-[0-9]" packages.list; then
    1.46 +				if grep -q "^$PACKAGE-[0-9A-Z]" packages.list; then
    1.47  					# Set new pkg and version for futur comparaison
    1.48 -					NEW_PACKAGE=`grep ^$PACKAGE-[0-9] packages.list`
    1.49 +					NEW_PACKAGE=`grep ^$PACKAGE-[0-9A-Z] packages.list`
    1.50  					NEW_VERSION=`echo $NEW_PACKAGE | sed s/$PACKAGE-/''/`
    1.51  					# Change '-' and 'pre' to points.
    1.52  					NEW_VERSION=`echo $NEW_VERSION | sed s/'-'/'.'/`