Fix '-s' command line switch.

The '-s' switch got broken, mainly because it used "leaking"
variables. Give it a proper interface, and use that.
Also, properly check for search failures.

Signed-off-by: Mauro Giachero <mauro.giachero@gmail.com>
This commit is contained in:
mauro.giachero 2009-05-21 16:34:09 +00:00
parent e3421a6bd5
commit 30ad5a995d

View file

@ -2042,6 +2042,11 @@ string_search() {
show_readme() {
# Show the package's text files.
# $1 = Package path
# $2 = Package name
local PKGPATH=$1
local PKGNAME=$2
cd $REPO_DIR
$PAGER \
@ -3668,9 +3673,12 @@ else
check_if_repo_exists
for PKGSEARCH in "$SEARCH"; do
echo "Searching for $PKGSEARCH"
search_package "$PKGSEARCH"
pick_file info "$PKGPATH" "$PKGSEARCH"
show_readme
if search_package $PKGSEARCH; then
pick_file info $PKGPATH $PKGSEARCH
show_readme $PKGPATH $PKGSEARCH
else
echo "ERROR: Package \"$PKGSEARCH\" not found." >&2
fi
done
fi