mirror of
https://github.com/sbopkg/sbopkg
synced 2024-11-10 03:50:33 +03:00
add while loop in the search results display page so that after viewing a search item, the user is returned to the search results
This commit is contained in:
parent
b4c92cdce8
commit
98fdb52d1d
@ -580,26 +580,29 @@ gen_search_package () {
|
|||||||
# interface, jump to selected package.
|
# interface, jump to selected package.
|
||||||
cd $LOCALREPO/$SLACKVER
|
cd $LOCALREPO/$SLACKVER
|
||||||
PKG=$1
|
PKG=$1
|
||||||
RESULTS=$(find . -mindepth 2 -type d | grep $PKG | sed -e 's/.\///')
|
RESULTS=$(find . -mindepth 2 -maxdepth 2 -type d | grep $PKG | sed -e 's/.\///')
|
||||||
if [ -n "$RESULTS" ]; then
|
if [ -n "$RESULTS" ]; then
|
||||||
if [ "$DIAG" = 1 ]; then
|
if [ "$DIAG" = 1 ]; then
|
||||||
for i in $RESULTS; do
|
for i in $RESULTS; do
|
||||||
DESC=$(grep -hZm1 ^$(echo "$i" | cut -d/ -f2) ./$i/slack-desc* | cut -d\( -f2- | cut -d\) -f1)
|
DESC=$(grep -hZm1 ^$(echo "$i" | cut -d/ -f2) ./$i/slack-desc* | cut -d\( -f2- | cut -d\) -f1)
|
||||||
echo "\"$i\" \"$DESC\"" >> $TMP/sbopkg_search_results
|
echo "\"$i\" \"$DESC\"" >> $TMP/sbopkg_search_results
|
||||||
done
|
done
|
||||||
dialog --title "Matches for $PKG" --menu "Please select an \
|
while [ -f $TMP/sbopkg_search_results ]; do
|
||||||
|
dialog --title "Matches for $PKG" --menu "Please select an \
|
||||||
item you wish to view." 20 70 14 --file \
|
item you wish to view." 20 70 14 --file \
|
||||||
$TMP/sbopkg_search_results 2>$TMP/sbopkg_search_choice
|
$TMP/sbopkg_search_results 2>$TMP/sbopkg_search_choice
|
||||||
if [ ! $? = 1 ]; then
|
if [ ! $? = 1 ]; then
|
||||||
SRCHPICK="$(cat $TMP/sbopkg_search_choice)"
|
SRCHPICK="$(cat $TMP/sbopkg_search_choice)"
|
||||||
SRCHCAT=$(echo $SRCHPICK | sed -e 's/\/.*$//')
|
SRCHCAT=$(echo $SRCHPICK | sed -e 's/\/.*$//')
|
||||||
SRCHPKG=$(echo $SRCHPICK | sed -e 's/^.*\///')
|
SRCHPKG=$(echo $SRCHPICK | sed -e 's/^.*\///')
|
||||||
echo $SRCHCAT > $TMP/sbopkg_category_selection
|
echo $SRCHCAT > $TMP/sbopkg_category_selection
|
||||||
echo $SRCHPKG > $TMP/sbopkg_item_selection
|
echo $SRCHPKG > $TMP/sbopkg_item_selection
|
||||||
cd $LOCALREPO/$SLACKVER
|
cd $LOCALREPO/$SLACKVER
|
||||||
info_item
|
info_item
|
||||||
fi
|
else
|
||||||
rm -rf $TMP/sbopkg_search_results
|
rm -rf $TMP/sbopkg_search_results
|
||||||
|
fi
|
||||||
|
done
|
||||||
continue
|
continue
|
||||||
else
|
else
|
||||||
echo "Found the following matches for $PKG:"
|
echo "Found the following matches for $PKG:"
|
||||||
|
Loading…
Reference in New Issue
Block a user