link new search to dialog search interface -- works well; minor typo fixes

This commit is contained in:
chess.griffin 2008-04-08 19:54:52 +00:00
parent aff26f4024
commit 2e15e69876

View file

@ -24,7 +24,7 @@
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# #
# Slackware is a registered trademark of Patrick Volkerding. # Slackware is a registered trademark of Patrick Volkerding.
# Linux is a registered trademark of Linux Torvalds. # Linux is a registered trademark of Linus Torvalds.
# #
# Other contributors: Bob Lounsbury, Robby Workman, Alan Hicks, Paul # Other contributors: Bob Lounsbury, Robby Workman, Alan Hicks, Paul
# Wisehart, slakmagik (thanks for your diff!), Eric Hameleers, # Wisehart, slakmagik (thanks for your diff!), Eric Hameleers,
@ -409,7 +409,7 @@ fi
. $PKGPATH/$PKG.info . $PKGPATH/$PKG.info
PKGNAME=${PKG##*/} PKGNAME=${PKG##*/}
SRCNAME=${DOWNLOAD##*/} SRCNAME=${DOWNLOAD##*/}
cd - #cd -
} }
gen_search_package () { gen_search_package () {
@ -419,21 +419,32 @@ cd $LOCALREPO/$SLACKVER
PKG=$1 PKG=$1
RESULTS=$(find . -type d | grep $PKG | sed -e 's/.\///') RESULTS=$(find . -type d | grep $PKG | sed -e 's/.\///')
if [ -n "$RESULTS" ]; then if [ -n "$RESULTS" ]; then
echo "Found the following matches for $PKG:" if [ "$DIAG" = 1 ]; then
for i in $RESULTS; do #for i in ${RESULTS[*]%/}; do
echo $i for i in $RESULTS; do
done echo "$i" >> $TMP/sbopkg_search_results
continue done
dialog --title "Matches for $PKG" --textbox \
$TMP/sbopkg_search_results 15 50
rm -rf $TMP/sbopkg_search_results
continue
else
echo "Found the following matches for $PKG:"
for i in $RESULTS; do
echo $i
done
continue
fi
else else
if [ "$DIAG" = 1 ]; then if [ "$DIAG" = 1 ]; then
dialog --title "ERROR" --msgbox "Package $PKG not found" 0 0 dialog --title "ERROR" --msgbox "No match for $PKG found" 8 30
continue continue
else else
echo "$SCRIPT: No match for $PKG found." 1>&2 echo "$SCRIPT: No match for $PKG found." 1>&2
continue continue
fi fi
fi fi
cd - #cd -
} }
show_readme () { show_readme () {
@ -467,6 +478,7 @@ fi
build_package () { build_package () {
# Start fetching and building the package. # Start fetching and building the package.
echo ; echo "Building $PKG" echo ; echo "Building $PKG"
cd $LOCALREPO/$SLACKVER
cd $PKGPATH cd $PKGPATH
get_source get_source
echo "Checking MD5SUM for "$SRCNAME"..." echo "Checking MD5SUM for "$SRCNAME"..."
@ -629,9 +641,10 @@ to search for" 0 0 2>/$TMP/sbopkg_search_request
continue continue
fi fi
SRCH="$(cat $TMP/sbopkg_search_request)" SRCH="$(cat $TMP/sbopkg_search_request)"
search_package $SRCH #search_package $SRCH
SRCHRESULT="$(echo $PKGPATH | sed 's/^.\///')" gen_search_package $SRCH
dialog --title "Package location" --msgbox "$SRCHRESULT" 8 30 #SRCHRESULT="$(echo $PKGPATH | sed 's/^.\///')"
#dialog --title "Package location" --msgbox "$SRCHRESULT" 8 30
fi fi
if [ "$R" = "Cache" ]; then if [ "$R" = "Cache" ]; then