initial search code in dialog interface; tweak sbopkg.8 man page

This commit is contained in:
chess.griffin 2008-04-01 13:10:28 +00:00
parent dc9c37ed35
commit 250c4cb11b
2 changed files with 62 additions and 28 deletions

View File

@ -364,12 +364,19 @@ SRCNAME=${DOWNLOAD##*/}
show_readme () {
# Show the package's text files.
# Thanks to slakmagik, this works much better. I may still look at
# other ways to do this. Perhaps have a way for the user to choose
# which of the 4 docs he wants to view? Or have a menu listing
# the 4 docs? Undecided.
${PAGER:-more} $PKGPATH/{README,$PKGNAME.SlackBuild,$PKGNAME.info,\
slack-desc}
# I am still not happy with how this works and am trying to think
# of a better way to have these 4 docs available for viewing from the
# cli. Maybe have -s just return the readme, as the result of a
# search, and maybe have another option like -v to view all 4 docs?
# Also, maybe have a way for the user to choose which of the 4 docs he
# wants to view? Or have a menu listing the 4 docs? Undecided.
SBODOCS="README $PKGNAME.SlackBuild $PKGNAME.info slack-desc"
for i in $SBODOCS; do
echo
echo "Viewing "$i":"
${PAGER:-more} $PKGPATH/$i
read # This was added because README was scrolling past too quickly
done
return 0
}
@ -460,10 +467,11 @@ while [ 0 ]; do
dialog --title "SlackBuilds.org Package Browser \
(sbopkg version $VER)" --menu \
"\nChoose one of the following or press <Cancel> to exit\n" \
15 60 6 \
15 60 7 \
"Rsync" "Rsync with SlackBuilds.org" \
"ChangeLog" "View the SlackBuilds.org ChangeLog" \
"Browse" "Browse the local SlackBuilds.org repo" \
"Search" "Search the local SlackBuilds.org repo" \
"Cache" "View the contents of the cache directory" \
"Log" "View the permanent build log" \
"Exit" "Exit sbopkg" 2>$TMP/sbopkg_main_menu_answer
@ -488,6 +496,18 @@ if [ "$R" = "Browse" ]; then
browse_categories
fi
if [ "$R" = "Search" ]; then
dialog --inputbox "Enter the name of a package you would like \
to search for" 0 0 2>/$TMP/sbopkg_search_request
if [ $? = 1 ]; then
continue
fi
SRCH="$(cat $TMP/sbopkg_search_request)"
search_package $SRCH
SRCHRESULT="$(echo $PKGPATH | sed 's/^.\///')"
dialog --title "Package location" --msgbox "$SRCHRESULT" 8 30
fi
if [ "$R" = "Cache" ]; then
view_cache_dir
fi

View File

@ -1,4 +1,4 @@
.TH SBOPKG 8 "Mar 2008" sbopkg-0.0.4 ""
.TH SBOPKG 8 "Mar 2008" sbopkg-0.0.5 ""
.SH NAME
.B sbopkg
\ - The SlackBuilds.org Package Browser
@ -21,31 +21,42 @@ Before sbopkg can be used, a configuration file must be created at
Sbopkg can be run from the command line by simply invoking "sbopkg."
Doing so will launch the dialog-based interface, and the menus
provided should be fairly explanatory. The main menu allows the user
to rsync with the SlackBuilds.org repository, view the SlackBuilds.org
Changelog, display the contents of the local cache directory, display
the permanent build log, and browse the local copy of the SBo
repository. Once the browse function is chosen, the user can select
the category of software to view. After choosing a category, the user
can then view the various software packages available in the local SBo
repository. Selecting a package will display another menu allowing
the user to view the package's README, SlackBuild, .info, or
slack-desc file. The user can also edit the SlackBuild and the edited
SlackBuild will remain after doig an rsync. Additionally, if sbopkg
is run with root privileges, then the user can choose to build a
package as well using either the original SlackBuild or the
locally-edited one if present. If KEEPLOG is set to YES in the
sbopkg.conf file then a permanent log of the build process is saved in
/tmp/sbopkg-build-log.
provided should be fairly self-explanatory. The main menu allows the
user to rsync with the SlackBuilds.org repository, view the
SlackBuilds.org Changelog, display the contents of the local cache
directory where source tarballs are saved, display the permanent build
log, and browse or search the local copy of the SBo repository. Once
the browse function is chosen, the user can select the category of
software to view. After choosing a category, the user can then view
the various software packages available in that category within the
local SBo repository. Selecting a package will display another menu
allowing the user to view the package's README, SlackBuild, .info, or
slack-desc files. The user can also edit the SlackBuild and the
edited SlackBuild will remain after doing an rsync. Additionally, if
sbopkg is run with root privileges, then the user can choose to build
a package as well using either the original SlackBuild or the
locally-edited one, if present. Finally, if KEEPLOG is set to YES in
the sbopkg.conf file then a permanent log of the build process is
saved in /tmp/sbopkg-build-log.
Alternatively, sbopkg can be run from the command line without using
the dialog interface. Executing "sbopkg -h" will display a list of
options available from the command line.
Certain features of sbopkg rely on outside binaries, such as a pager
to view the text files when sbopkg is run from the comamnd line, and
an editor to edit the SlackBuild. The pager function will look to the
environmental variable $PAGER and if that variable is not defined then
it will default to 'more.' Similarly, the edit SlackBuild function
found when sbopkg is used with the dialog interface will look to
$EDITOR and will default to 'vi' if no $EDITOR has been defined.
.SH OPTIONS
.TP 5
.B -b PACKAGE
Search for and build PACKAGE from the local SBo repository
.B -b PACKAGE(s)
Search for and build PACKAGE(s) from the local SBo repository. If more
than one package is specified, they must be in quotes. For example
"sbopkg -b "foo bar".
.TP 5
.B -d DIRECTORY
@ -71,8 +82,11 @@ Display the SBo ChangeLog.txt and quit
Rsync the local repository with SlackBuilds.org and quit
.TP 5
.B -s PACKAGE
Search for PACKAGE and, if found, display the README
.B -s PACKAGE(s)
Search for PACKAGE(s) and, if found, display the README, SlackBuild,
.info, and slack-desc files in that order. If more than one
package is specified, they must be in quotes. For example
"sbopkg -s "foo bar".
.SH FILES
.B /etc/sbopkg/sbopkg.conf