add a regex fix to remove some double quotes; also split the regex's out into separate lines for easier reading; thanks to Mauro and slakmagik.

This commit is contained in:
chess.griffin 2009-05-28 20:54:34 +00:00
parent c2c7cb1442
commit 26fc3f6ebe

View file

@ -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)-[^-]*-[^-]*-[^-]*\$")