From a5bfbf7c1b196928748ca5f604567446aa945fad Mon Sep 17 00:00:00 2001 From: "chess.griffin" Date: Fri, 18 Jul 2008 02:33:57 +0000 Subject: [PATCH] modified update code so only updates are shown by default; if the UPDATE_DEBUG variable at the top is uncommented, as it is in SVN and for RC releases, then all packages are shown, including those that do not have updates as well as those when the installed version is actually newer than the repo. --- src/usr/bin/sbopkg | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/src/usr/bin/sbopkg b/src/usr/bin/sbopkg index c485840..40a58f6 100755 --- a/src/usr/bin/sbopkg +++ b/src/usr/bin/sbopkg @@ -188,6 +188,7 @@ if [ -e "$PKGS" ]; then else echo "Listing installed SlackBuilds.org packages and flagging \ potential updates..." >> $UPDATELIST + echo >> $UPDATELIST for i in $PKGS; do # This next code is borrowed and modified from pkgtool #echo $i | sed 's/_SBo$//;s/-[^-]*-[^-]*-[^-]*$//' @@ -202,7 +203,6 @@ potential updates..." >> $UPDATELIST ARCH="$(echo $STRING | cut -f $ARCH -d -)" BUILD="$(echo $STRING | cut -f $INDEX -d -)" # End pkgtool code - echo $NAME: >> $UPDATELIST CURPKG=$(echo $NAME-$VER-$ARCH-$BUILD) NEWSB=$(find $LOCALREPO/$SLACKVER -name "$NAME.SlackBuild") NEWINFO=$(find $LOCALREPO/$SLACKVER -name "$NAME.info") @@ -210,18 +210,33 @@ potential updates..." >> $UPDATELIST . $NEWINFO NEWARCH=$(egrep -m1 "^ARCH" $NEWSB | sed -e 's/^.*[=-]//;s/[ #}\t].*$//g') NEWBUILD=$(egrep -m1 "^BUILD" $NEWSB | sed -e 's/^.*-//;s/[ }\t].*$//g') - echo $CURPKG > $TMP/sbopkg_full - if ! grep -q "$PRGNAM-$VERSION-$NEWARCH-$NEWBUILD" $TMP/sbopkg_full; then + if [[ $VERSION > $VER ]]; then + echo $NAME: >> $UPDATELIST echo " POTENTIAL UPDATE" >> $UPDATELIST echo " Installed version: " $CURPKG >> $UPDATELIST echo " Repo version: " $PRGNAM-$VERSION-$NEWARCH-$NEWBUILD >> $UPDATELIST - else - echo " No update." >> $UPDATELIST + elif [[ $VERSION < $VER ]]; 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 + if [ "$UPDATE_DEBUG" = 1 ]; then + echo $NAME: >> $UPDATELIST + echo " No update." >> $UPDATELIST + fi fi else - echo " Not in the repo." >> $UPDATELIST + if [ "$UPDATE_DEBUG" = 1 ]; then + echo $NAME: >> $UPDATELIST + echo " Not in the repo." >> $UPDATELIST + fi fi done + echo >> $UPDATELIST + echo "Potential update list complete." >> $UPDATELIST fi if [ "$DIAG" = 1 ]; then dialog --title "Viewing potential updates." --textbox \