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
|
else
|
||||||
echo "Listing installed SlackBuilds.org packages and flagging \
|
echo "Listing installed SlackBuilds.org packages and flagging \
|
||||||
potential updates..." >> $UPDATELIST
|
potential updates..." >> $UPDATELIST
|
||||||
|
echo >> $UPDATELIST
|
||||||
for i in $PKGS; do
|
for i in $PKGS; do
|
||||||
# This next code is borrowed and modified from pkgtool
|
# This next code is borrowed and modified from pkgtool
|
||||||
#echo $i | sed 's/_SBo$//;s/-[^-]*-[^-]*-[^-]*$//'
|
#echo $i | sed 's/_SBo$//;s/-[^-]*-[^-]*-[^-]*$//'
|
||||||
@ -202,7 +203,6 @@ potential updates..." >> $UPDATELIST
|
|||||||
ARCH="$(echo $STRING | cut -f $ARCH -d -)"
|
ARCH="$(echo $STRING | cut -f $ARCH -d -)"
|
||||||
BUILD="$(echo $STRING | cut -f $INDEX -d -)"
|
BUILD="$(echo $STRING | cut -f $INDEX -d -)"
|
||||||
# End pkgtool code
|
# End pkgtool code
|
||||||
echo $NAME: >> $UPDATELIST
|
|
||||||
CURPKG=$(echo $NAME-$VER-$ARCH-$BUILD)
|
CURPKG=$(echo $NAME-$VER-$ARCH-$BUILD)
|
||||||
NEWSB=$(find $LOCALREPO/$SLACKVER -name "$NAME.SlackBuild")
|
NEWSB=$(find $LOCALREPO/$SLACKVER -name "$NAME.SlackBuild")
|
||||||
NEWINFO=$(find $LOCALREPO/$SLACKVER -name "$NAME.info")
|
NEWINFO=$(find $LOCALREPO/$SLACKVER -name "$NAME.info")
|
||||||
@ -210,18 +210,33 @@ potential updates..." >> $UPDATELIST
|
|||||||
. $NEWINFO
|
. $NEWINFO
|
||||||
NEWARCH=$(egrep -m1 "^ARCH" $NEWSB | sed -e 's/^.*[=-]//;s/[ #}\t].*$//g')
|
NEWARCH=$(egrep -m1 "^ARCH" $NEWSB | sed -e 's/^.*[=-]//;s/[ #}\t].*$//g')
|
||||||
NEWBUILD=$(egrep -m1 "^BUILD" $NEWSB | sed -e 's/^.*-//;s/[ }\t].*$//g')
|
NEWBUILD=$(egrep -m1 "^BUILD" $NEWSB | sed -e 's/^.*-//;s/[ }\t].*$//g')
|
||||||
echo $CURPKG > $TMP/sbopkg_full
|
if [[ $VERSION > $VER ]]; then
|
||||||
if ! grep -q "$PRGNAM-$VERSION-$NEWARCH-$NEWBUILD" $TMP/sbopkg_full; then
|
echo $NAME: >> $UPDATELIST
|
||||||
echo " POTENTIAL UPDATE" >> $UPDATELIST
|
echo " POTENTIAL UPDATE" >> $UPDATELIST
|
||||||
echo " Installed version: " $CURPKG >> $UPDATELIST
|
echo " Installed version: " $CURPKG >> $UPDATELIST
|
||||||
echo " Repo version: " $PRGNAM-$VERSION-$NEWARCH-$NEWBUILD >> $UPDATELIST
|
echo " Repo version: " $PRGNAM-$VERSION-$NEWARCH-$NEWBUILD >> $UPDATELIST
|
||||||
else
|
elif [[ $VERSION < $VER ]]; then
|
||||||
echo " No update." >> $UPDATELIST
|
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
|
fi
|
||||||
else
|
else
|
||||||
echo " Not in the repo." >> $UPDATELIST
|
if [ "$UPDATE_DEBUG" = 1 ]; then
|
||||||
|
echo $NAME: >> $UPDATELIST
|
||||||
|
echo " Not in the repo." >> $UPDATELIST
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
echo >> $UPDATELIST
|
||||||
|
echo "Potential update list complete." >> $UPDATELIST
|
||||||
fi
|
fi
|
||||||
if [ "$DIAG" = 1 ]; then
|
if [ "$DIAG" = 1 ]; then
|
||||||
dialog --title "Viewing potential updates." --textbox \
|
dialog --title "Viewing potential updates." --textbox \
|
||||||
|
Loading…
Reference in New Issue
Block a user