tazpkg rev 516

tazpkg: Added support for upgrade to work with undigest repos using $LOCALSTATE/priority file.
author Christopher Rogers <slaxemulator@gmail.com>
date Sun Jun 26 08:35:00 2011 +0000 (2011-06-26)
parents 6d86f1a46a68
children 0d2c2fa5dc6c
files tazpkg
line diff
     1.1 --- a/tazpkg	Mon Jun 20 17:42:29 2011 +0200
     1.2 +++ b/tazpkg	Sun Jun 26 08:35:00 2011 +0000
     1.3 @@ -2357,7 +2357,20 @@
     1.4  					install="n" ;;
     1.5  			esac
     1.6  		done
     1.7 -		mtime=`find /var/lib/tazpkg/packages.list -mtime +7`
     1.8 +		installed_md5=$LOCALSTATE/installed.md5
     1.9 +		pkg_desc=$LOCALSTATE/packages.desc
    1.10 +		pkg_list=$LOCALSTATE/packages.list
    1.11 +		pkg_md5=$LOCALSTATE/packages.md5
    1.12 +		if [ -f $LOCALSTATE/priority ]; then
    1.13 +			for i in $(cat $LOCALSTATE/priority); do
    1.14 +				if [ -f $LOCALSTATE/undigest/$i/mirror ]; then
    1.15 +					pkg_desc=$LOCALSTATE/undigest/$i/packages.desc
    1.16 +					pkg_list=$LOCALSTATE/undigest/$i/packages.list
    1.17 +					pkg_md5=$LOCALSTATE/undigest/$i/packages.md5
    1.18 +				fi
    1.19 +			done
    1.20 +		fi
    1.21 +		mtime=`find $pkg_list -mtime +7`
    1.22  		if [ "$mtime" ]; then
    1.23  			gettext "Your packages list is older than one week... recharging"
    1.24  			tazpkg recharge
    1.25 @@ -2375,11 +2388,11 @@
    1.26  			unset VERSION EXTRAVERSION
    1.27  			. $pkg/receipt
    1.28  			md5=$(fgrep "  $PACKAGE-${VERSION}$EXTRAVERSION.tazpkg" \
    1.29 -				../installed.md5 | awk '{print $1}')
    1.30 -			if ! fgrep -q "$md5  $PACKAGE-" ../packages.md5; then
    1.31 +				$installed_md5 | awk '{print $1}')
    1.32 +			if ! fgrep -q "$md5  $PACKAGE-" $pkg_md5; then
    1.33  				# Skip when not found on mirror (local package)
    1.34 -				grep -q ^$PACKAGE- ../packages.list || continue
    1.35 -				new=$(grep "^$PACKAGE |" ../packages.desc | awk '{print $3}')
    1.36 +				grep -q ^$PACKAGE- $pkg_list || continue
    1.37 +				new=$(grep "^$PACKAGE |" $pkg_desc | awk '{print $3}')
    1.38  				if $(grep -qs "^$PACKAGE" $BLOCKED); then
    1.39  					# Skip pkgs listed in $LOCALSTATE/blocked-packages.list
    1.40  					blocked_count=$(($blocked_count+1))