Fixed issue 45 (problem detecting packages with '+' in the name).

Converted an egrep in info_item() into a grep to avoid issues with '+' being a
metacharacter.

Also removed stale lines (since r631) from gen_search_package() and
string_search(). Also added a couple of credits to the ChangeLog.
This commit is contained in:
slakmagik 2010-04-27 20:52:25 +00:00
parent 904d98dd15
commit 1bda5605aa
2 changed files with 7 additions and 13 deletions

View file

@ -5,8 +5,11 @@ enhancements:
* Addressed an apparent bash 4.1 bug that causes the 'obsolete sources'
function to break.
* Addressed issue 44 where hitting ^C during the download of part of a queue
and restarting the queue could result in a download failure.
and restarting the queue could result in a download failure. Thanks to
slava18 for the report.
* Changed the menu order of the "Build options" dialog to default to using
"Saved" options rather than "None".
* Fixed issue 45 where packages with '+' in the name were not properly
detected in some cases. Thanks to skalkoto for the report.
+--------------------------+

View file

@ -1129,8 +1129,10 @@ info_item() {
eval CUR$(grep -m1 ^BUILD= $SHORTPATH/$APP.SlackBuild)
[[ -z $CURARCH ]] && CURARCH=unknown
while :; do
# we use GNU grep extensions rather than egrep to avoid issues with
# the '+' metacharacter which can be found in package names
INSTALLEDPACKAGE=$(ls /var/log/packages |
egrep "^($APP|$OLDPKG)-[^-]*-[^-]*-[^-]*\$")
grep "^\($APP\|$OLDPKG\)-[^-]*-[^-]*-[^-]*\$")
# Only get the first package (not that the same package should be
# installed more than once on a sane system...)
INSTALLEDPACKAGE=$(head -n 1 <<< "$INSTALLEDPACKAGE")
@ -2397,7 +2399,6 @@ gen_search_package() {
-iwholename "./$CATEGORY/*$PKG*" -printf "%P\n" | sort)
local NAME DESC CHOICE
local SRCHPICK SRCHCAT SRCHPKG
local SHORTPATH RVERSION RBUILD
if [[ $RESULTS ]]; then
if [[ $DIAG ]]; then
@ -2439,11 +2440,6 @@ gen_search_package() {
fi
echo $SRCHCAT > $CAT_SELECTION
SRCHPKG="${SRCHPICK##*/}"
SHORTPATH=$REPO_DIR/$SRCHCAT/$SRCHPKG
RVERSION=$(grep VERSION $SHORTPATH/$SRCHPKG.info |
cut -d= -f2 | sed s/\"//g)
RBUILD=$(egrep -m1 "^BUILD" $SHORTPATH/$SRCHPKG.SlackBuild |
sed -e 's/^.*[=-]//;s/\"//;s/[ #}\t].*$//g;s/\"//g')
if [[ $CHOICE == 0 ]]; then
echo $SRCHPKG > $ITEM_SELECTION
cd $REPO_DIR
@ -2549,11 +2545,6 @@ string_search() {
fi
;;
3) # Add to Queue
SHORTPATH=$REPO_DIR/$SRCHCAT/$SRCHPKG
RVERSION=$(grep VERSION $SHORTPATH/$SRCHPKG.info |
cut -d= -f2 | sed s/\"//g)
RBUILD=$(egrep -m1 "^BUILD" $SHORTPATH/$SRCHPKG.SlackBuild |
sed -e 's/^.*[=-]//;s/\"//;s/[ #}\t].*$//g;s/\"//g')
add_item_to_queue $SRCHPKG
continue
;;