fix update code to check for build; add in possible future code to check for version numbers that are pegged to svn or other unusual numbering sequences

This commit is contained in:
chess.griffin 2008-07-23 01:12:45 +00:00
parent 96c0bbfb74
commit 5786a8cefb

View file

@ -201,7 +201,10 @@ potential updates..." >> $UPDATELIST
NAME=$(expr $INDEX - 3)
NAME="$(echo $STRING | cut -f 1-$NAME -d -)"
VER=$(expr $INDEX - 2)
#VER="$(echo $STRING | cut -f $VER -d - | sed -e 's/_.*$//')"
VER="$(echo $STRING | cut -f $VER -d -)"
#EXTRA=$(expr $INDEX - 2)
#EXTRA="$(echo $STRING | cut -f $EXTRA -d _)"
ARCH=$(expr $INDEX - 1)
ARCH="$(echo $STRING | cut -f $ARCH -d -)"
BUILD="$(echo $STRING | cut -f $INDEX -d -)"
@ -211,21 +214,23 @@ potential updates..." >> $UPDATELIST
NEWINFO=$(find $LOCALREPO/$SLACKVER -name "$NAME.info")
if [ -n "$NEWINFO" ]; then
. $NEWINFO
NEWARCH=$(egrep -m1 "^ARCH" $NEWSB | sed -e 's/^.*[=-]//;s/[ #}\t].*$//g')
NEWBUILD=$(egrep -m1 "^BUILD" $NEWSB | sed -e 's/^.*-//;s/[ }\t].*$//g')
if [[ $VERSION > $VER ]]; then
NEWARCH=$(egrep -m1 "^ARCH" $NEWSB | sed -e 's/[ #}\t].*$//;s/^.*[=-]//;s/\"//g')
NEWSRCVER=$(egrep -m1 "^SRCVER" $NEWSB | sed -e 's/[ #}\t].*$//;s/^.*[=-]//;s/\"//g')
#NEWARCH=$(egrep -m1 "^ARCH" $NEWSB | sed -e 's/^.*[=-]//;s/\"//;s/[ #}\t].*$//g')
NEWBUILD=$(egrep -m1 "^BUILD" $NEWSB | sed -e 's/^.*[=-]//;s/\"//;s/[ #}\t].*$//g')
if [[ $VERSION-$NEWARCH-$NEWBUILD > $VER-$ARCH-$BUILD ]]; then
echo $NAME: >> $UPDATELIST
echo " POTENTIAL UPDATE" >> $UPDATELIST
echo " Installed version: " $CURPKG >> $UPDATELIST
echo " Repo version: " $PRGNAM-$VERSION-$NEWARCH-$NEWBUILD >> $UPDATELIST
elif [[ $VERSION < $VER ]]; then
elif [[ $VERSION-$NEWARCH-$NEWBUILD < $VER-$ARCH-$BUILD ]]; then
if [ "$UPDATE_DEBUG" = 1 ]; then
echo $NAME: >> $UPDATELIST
echo " INSTALLED PACKAGE IS NEWER THAN REPO" >> $UPDATELIST
echo " Installed version: " $CURPKG >> $UPDATELIST
echo " Repo version: " $PRGNAM-$VERSION-$NEWARCH-$NEWBUILD >> $UPDATELIST
fi
elif [[ $VERSION = $VER ]]; then
elif [[ $VERSION-$NEWARCH-$NEWBUILD = $VER-$ARCH-$BUILD ]]; then
if [ "$UPDATE_DEBUG" = 1 ]; then
echo $NAME: >> $UPDATELIST
echo " No update." >> $UPDATELIST
@ -699,7 +704,7 @@ dialog --title "SlackBuilds.org Package Browser \
15 65 9 \
"Rsync" "Rsync with SlackBuilds.org" \
"ChangeLog" "View the SlackBuilds.org ChangeLog" \
"Updates" "List installed packages and potential updates" \
"Updates" "List potential updates to installed packages" \
"Browse" "Browse the local SlackBuilds.org repo" \
"Search" "Search the local SlackBuilds.org repo" \
"Cache" "View the contents of the cache directory" \