tazpkg diff tazpkg @ rev 112
Fix tazpkg upgrade
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Wed Jul 02 10:54:15 2008 +0000 (2008-07-02) |
parents | 94bd7f860e6f |
children | a9bee8467895 |
line diff
1.1 --- a/tazpkg Tue Jul 01 20:09:56 2008 +0000 1.2 +++ b/tazpkg Wed Jul 02 10:54:15 2008 +0000 1.3 @@ -218,12 +218,15 @@ 1.4 get_package_fullname_in_list() 1.5 { 1.6 local pkg=$1 1.7 + local i 1.8 while [ "$pkg" != "${pkg%-*}" ]; do 1.9 pkg=${pkg%-*} 1.10 - if grep -q ^$pkg $2; then 1.11 - grep ^$pkg $2 # echo 1.12 - break 1.13 - fi 1.14 + for i in '-[0-9]' '-.[0-9]' '-'; do 1.15 + if grep -q ^$pkg$i $2; then 1.16 + grep ^$pkg$i $2 | head -1 # echo 1.17 + return 1.18 + fi 1.19 + done 1.20 done 1.21 } 1.22 1.23 @@ -1200,7 +1203,9 @@ 1.24 else 1.25 # Check if the installed package is in the current list (other 1.26 # mirror or local). 1.27 - NEW_PACKAGE=$(get_package_fullname_in_list $PACKAGE packages.list) 1.28 + NEW_PACKAGE=$(grep "^$PACKAGE-[0-9]" packages.list | head -1) 1.29 + [ -n "$NEW_PACKAGE" ] || NEW_PACKAGE=$(grep "^$PACKAGE-.[\.0-9]" packages.list | head -1) 1.30 + 1.31 if [ -n "$NEW_PACKAGE" ]; then 1.32 # Set new pkg and version for futur comparaison 1.33 NEW_VERSION=`echo $NEW_PACKAGE | sed s/$PACKAGE-/''/` 1.34 @@ -1209,6 +1214,8 @@ 1.35 VERSION=`echo $VERSION | sed s/'-'/'.'/` 1.36 NEW_VERSION=`echo $NEW_VERSION | sed s/'pre'/'.'/` 1.37 VERSION=`echo $VERSION | sed s/'pre'/'.'/` 1.38 + NEW_VERSION=`echo $NEW_VERSION | sed 's/[A-Z]\.//'` 1.39 + VERSION=`echo $VERSION | sed 's/[A-Z]\.//'` 1.40 # Compare version. Upgrade are only avalaible for official 1.41 # packages, so we control de mirror and it should be ok if 1.42 # we just check for egality.