From 72946b5b56927b8ba43901431536d6890243fcfe Mon Sep 17 00:00:00 2001 From: Silvan Calarco Date: Tue, 20 Jan 2015 00:15:50 +0100 Subject: [PATCH] openmamba-netsrpms: fix: don't report for updates available when network is down --- openmamba-update/openmamba-netsrpms | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/openmamba-update/openmamba-netsrpms b/openmamba-update/openmamba-netsrpms index b990eb6..599281b 100755 --- a/openmamba-update/openmamba-netsrpms +++ b/openmamba-update/openmamba-netsrpms @@ -58,7 +58,12 @@ for pckname in $PACKAGES; do 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` [ $? -eq 0 ] || RPM_INSTALLED= @@ -72,13 +77,13 @@ for pckname in $PACKAGES; do echo $"Last version: $SRPM_VERSION" echo - if [ "$RPM_INSTALLED_VERSION" != "$SRPM_VERSION" ]; then + if [ "$SRPM_VERSION" -a "$RPM_INSTALLED_VERSION" != "$SRPM_VERSION" ]; then if [ "$RPM_INSTALLED_VERSION" ]; then UPDATE_NEEDED=1 elif [ "$UPGRADE_MODE" ]; then continue fi - elif [ ! "$FORCE_MODE" ]; then + elif [ ! "$FORCE_MODE" -a "$SRPM_VERSION" ]; then continue fi