mirror of
https://github.com/sbopkg/sbopkg
synced 2024-11-10 03:50:33 +03:00
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.
This commit is contained in:
parent
d86d8bd6b9
commit
a5bfbf7c1b
@ -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
|
||||
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
|
||||
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 \
|
||||
|
Loading…
Reference in New Issue
Block a user