From 9c775aa6847321db979eae449c03c48c3f68bcf8 Mon Sep 17 00:00:00 2001 From: "chess.griffin" Date: Thu, 8 Oct 2009 14:45:27 +0000 Subject: [PATCH] fix cosmetic bug where ARCH and BUILD were not displaying correctly in the updates list; thanks to Mauro and slakmagik for the actual working code for this fix --- ChangeLog-current.txt | 4 +++- src/usr/sbin/sbopkg | 30 ++++++------------------------ 2 files changed, 9 insertions(+), 25 deletions(-) diff --git a/ChangeLog-current.txt b/ChangeLog-current.txt index ab4486f..f9b0b0d 100644 --- a/ChangeLog-current.txt +++ b/ChangeLog-current.txt @@ -1,4 +1,4 @@ -Sun Sep 6 04:10:58 UTC 2009 +Thu Oct 8 14:44:23 UTC 2009 Sbopkg 0.XX.X released. This version contains the following fixes and enhancements: @@ -26,4 +26,6 @@ enhancements: * Modify sspm to be root-only and change the default checkout location. In case it isn't obvious, this means the checkout will be root-owned if it isn't already. + * Fix cosmetic bug where ARCH and BUILD were not displaying correctly in + list of updates on x86_64. +--------------------------+ diff --git a/src/usr/sbin/sbopkg b/src/usr/sbin/sbopkg index 84f4b44..af824a6 100755 --- a/src/usr/sbin/sbopkg +++ b/src/usr/sbin/sbopkg @@ -698,18 +698,9 @@ check_for_updates() { # Extract the new package version if [[ ! -z $NEWSB ]]; then - NEWARCH=$(egrep -m1 "^ARCH" $NEWSB | sed ' - s/\([^\t #]*\)[\t #].*/\1/ - s/[^=]*=// - s/"//g - s/\${[^-]*-\(.*\)}/\1/ - s/\$.*/unknown/ - ') - NEWBUILD=$(egrep -m1 "^BUILD" $NEWSB | sed ' - s/^.*[=-]// - s/"//g - s/[ #}\t].*$//g - ') + eval NEW$(grep -m1 ^ARCH= $NEWSB) + eval NEW$(grep -m1 ^BUILD= $NEWSB) + [[ -z $NEWARCH ]] && NEWARCH=unknown # Step 1 - find the version expression # This looks for the last instance of $OUTPUT. @@ -1111,18 +1102,9 @@ info_item() { SHORTPATH=$REPO_DIR/$CATEGORY/$APP CURVERSION=$(grep VERSION $SHORTPATH/$APP.info | cut -d= -f2 | sed s/\"//g) - CURARCH=$(egrep -m1 "^ARCH" $SHORTPATH/$APP.SlackBuild | sed ' - s/\([^\t #]*\)[\t #].*/\1/ - s/[^=]*=// - s/"//g - s/\${[^-]*-\(.*\)}/\1/ - s/\$.*/unknown/ - ') - CURBUILD=$(egrep -m1 "^BUILD" $SHORTPATH/$APP.SlackBuild | sed ' - s/^.*[=-]// - s/"//g - s/[ #}\t].*$//g - ') + eval CUR$(grep -m1 ^ARCH= $SHORTPATH/$APP.SlackBuild) + eval CUR$(grep -m1 ^BUILD= $SHORTPATH/$APP.SlackBuild) + [[ -z $CURARCH ]] && CURARCH=unknown while :; do INSTALLEDPACKAGE=$(ls /var/log/packages | egrep "^($APP|$OLDPKG)-[^-]*-[^-]*-[^-]*\$")