From 30ad5a995dd49ef33180e4e9f522ea23f451ee45 Mon Sep 17 00:00:00 2001 From: "mauro.giachero" Date: Thu, 21 May 2009 16:34:09 +0000 Subject: [PATCH] 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 --- src/usr/sbin/sbopkg | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/usr/sbin/sbopkg b/src/usr/sbin/sbopkg index d6e4f12..be6e8ca 100755 --- a/src/usr/sbin/sbopkg +++ b/src/usr/sbin/sbopkg @@ -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