diff --git a/src/usr/sbin/sbopkg b/src/usr/sbin/sbopkg index ffe7831..8538e65 100755 --- a/src/usr/sbin/sbopkg +++ b/src/usr/sbin/sbopkg @@ -584,10 +584,18 @@ check_for_updates() { # Extract the new package version if [[ ! -z $NEWSB ]]; then - NEWARCH=$(egrep -m1 "^ARCH" $NEWSB | sed -e \ - 's/[ #}\t].*$//;s/^.*[=-]//;s/\"//g') - NEWBUILD=$(egrep -m1 "^BUILD" $NEWSB | sed -e \ - 's/^.*[=-]//;s/\"//;s/[ #}\t].*$//g;s/\"//g') + 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 + ') # Step 1 - find the version expression # This looks for the last instance of $OUTPUT. @@ -985,11 +993,18 @@ 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 -e "s/\([^\t #]*\)[\t #].*/\1/;s/[^=]*=//;s/\${[^-]*-\(.*\)}/\1/;\ - s/\$.*/unknown/") - CURBUILD=$(egrep -m1 "^BUILD" $SHORTPATH/$APP.SlackBuild | - sed -e 's/^.*[=-]//;s/\"//;s/[ #}\t].*$//g;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 + ') while :; do INSTALLEDPACKAGE=$(ls /var/log/packages | egrep "^($APP|$OLDPKG)-[^-]*-[^-]*-[^-]*\$")