openmamba-netsrpms: fix: don't report for updates available when network is down

This commit is contained in:
Silvan Calarco 2015-01-20 00:15:50 +01:00
parent 25529aee96
commit 72946b5b56

View File

@ -58,7 +58,12 @@ for pckname in $PACKAGES; do
icon=`grep Icon= /usr/share/applications/openmamba-$pckname.desktop | sed "s|Icon=||"` icon=`grep Icon= /usr/share/applications/openmamba-$pckname.desktop | sed "s|Icon=||"`
SRPM_VERSION=${SRPMVERSION[${pckname}]}-${SRPMRELEASE[${pckname}]} SRPMVER="${SRPMVERSION[${pckname}]}"
if [ "$SRPMVER" ]; then
SRPM_VERSION=${SRPMVER}-${SRPMRELEASE[${pckname}]}
else
SRPM_VERSION=
fi
RPM_INSTALLED=`rpm -q $pckname` RPM_INSTALLED=`rpm -q $pckname`
[ $? -eq 0 ] || RPM_INSTALLED= [ $? -eq 0 ] || RPM_INSTALLED=
@ -72,13 +77,13 @@ for pckname in $PACKAGES; do
echo $"Last version: $SRPM_VERSION" echo $"Last version: $SRPM_VERSION"
echo echo
if [ "$RPM_INSTALLED_VERSION" != "$SRPM_VERSION" ]; then if [ "$SRPM_VERSION" -a "$RPM_INSTALLED_VERSION" != "$SRPM_VERSION" ]; then
if [ "$RPM_INSTALLED_VERSION" ]; then if [ "$RPM_INSTALLED_VERSION" ]; then
UPDATE_NEEDED=1 UPDATE_NEEDED=1
elif [ "$UPGRADE_MODE" ]; then elif [ "$UPGRADE_MODE" ]; then
continue continue
fi fi
elif [ ! "$FORCE_MODE" ]; then elif [ ! "$FORCE_MODE" -a "$SRPM_VERSION" ]; then
continue continue
fi fi