aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Woodward2003-10-19 19:16:42 +0000
committerJason Woodward2003-10-19 19:16:42 +0000
commit87ef1a579b3bceb2ecffcb7ceb161cf98b5a920f (patch)
tree83450db7888110f70d10cd2ae52220738ba9111f
parent928ec6ae6c09a1d5b11d5a8c8ebac3775b29d2f8 (diff)
downloadslapt-get-87ef1a579b3bceb2ecffcb7ceb161cf98b5a920f.tar.gz
search now searches a packages location field as well
-rw-r--r--ChangeLog3
-rw-r--r--FAQ38
-rw-r--r--doc/slapt-get.82
-rw-r--r--src/action.c11
4 files changed, 43 insertions, 11 deletions
diff --git a/ChangeLog b/ChangeLog
index d963cfd..eb54798 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,9 +1,10 @@
-0.9.6d Oct 18, 2003
+0.9.6d Oct 19, 2003
* updated docs
* reworked parse_packages_txt function
* fixed possible buffer overflows in parse_packages_txt
* added more buffer checks in config parser
+ * search now searches a packages location field as well
0.9.6c Oct 15, 2003
* patch data is now fetched from patches/PACKAGES.TXT instead of
diff --git a/FAQ b/FAQ
index 6a1dedf..73cee1d 100644
--- a/FAQ
+++ b/FAQ
@@ -18,6 +18,7 @@ Frequenty Asked Questions:
15. What about Dropline support?
16. How can I generate an exclude list for an entire disk set?
17. How do I use a local file source?
+18. How can I make sure I have every package from the base installed?
@@ -57,7 +58,8 @@ Frequenty Asked Questions:
4. How do I find a package I want to install?
You can use the --search feature, supplying an expression. POSIX
- regular expressions are supported.
+ regular expressions are supported. This searches the name, location,
+ or descriptions of packages.
5. Can I upgrade all my installed packages?
@@ -116,6 +118,11 @@ Frequenty Asked Questions:
### then, let slapt-get upgrade the rest
$ slapt-get --upgrade
+ ### to make sure you install every package in the base
+ ### system, (see FAQ #18) use this:
+ ./slapt-get --search '^\.\/slackware\/a$'|awk '{print $1}'| \
+ xargs -r ./slapt-get --install
+
Then follow the rest of the directions in UPGRADE.TXT.
If you have a broken system, make sure aaa_base is at least installed.
@@ -252,16 +259,14 @@ Frequenty Asked Questions:
# this should gen an exclude list for a particular dir set (first arg to script)
DIR=$1
F=0
- for pkg in `./slapt-get --list|awk '{print $1}'`
+ for pkg in `./slapt-get --search "^\.\/slackware\/${DIR}$"|awk '{print $1}'`
do
- if [ -n "`./slapt-get --show ${pkg}|grep 'Package Location'|awk '{print $3}'|egrep "\W+${DIR}"`" ]; then
- if [ $F == 1 ]; then
- echo -n ,$pkg
- else
- echo -n $pkg
- fi
- F=1
+ if [ $F == 1 ]; then
+ echo -n ,$pkg
+ else
+ echo -n $pkg
fi
+ F=1
done
echo
@@ -393,3 +398,18 @@ Frequenty Asked Questions:
-e "s/ZXbXZ/$totaluncomp_m/g" > $final_target && rm $target
### END SCRIPT
+18. How can I make sure I have every package from the base installed?
+
+ If you just upgraded your Slackware install to a newer version, you may want
+ to make sure that you have all the required base packages installed. You can
+ use the --search option and supply a directory (as shown from --show pkg_name).
+
+ Most mirrors use ./slackware/a as the directory for the base. Thus to
+ upgrade:
+
+ ./slapt-get --search '^\.\/slackware\/a$'|awk '{print $1}'| \
+ xargs -r ./slapt-get --install
+
+ You can do the same thing to install a whole disk set... just change the
+ expression.
+
diff --git a/doc/slapt-get.8 b/doc/slapt-get.8
index 35f37e7..356a399 100644
--- a/doc/slapt-get.8
+++ b/doc/slapt-get.8
@@ -123,7 +123,7 @@ Show package description.
.TP
.B --search [expression]
Search available packages. Applies POSIX regular expression
-to the names and descriptions of packages.
+to the names, locations, and descriptions of packages.
.TP
.B --list
List available packages.
diff --git a/src/action.c b/src/action.c
index 0e48599..1f8f8c3 100644
--- a/src/action.c
+++ b/src/action.c
@@ -172,6 +172,7 @@ void pkg_action_search(const char *pattern){
for(iterator = 0; iterator < pkgs->pkg_count; iterator++ ){
if(
+ /* search pkg name */
( regexec(
&search_regex.regex,
pkgs->pkgs[iterator]->name,
@@ -180,6 +181,7 @@ void pkg_action_search(const char *pattern){
0
) == 0)
||
+ /* search pkg description */
( regexec(
&search_regex.regex,
pkgs->pkgs[iterator]->description,
@@ -187,6 +189,15 @@ void pkg_action_search(const char *pattern){
search_regex.pmatch,
0
) == 0)
+ ||
+ /* search pkg location */
+ ( regexec(
+ &search_regex.regex,
+ pkgs->pkgs[iterator]->location,
+ search_regex.nmatch,
+ search_regex.pmatch,
+ 0
+ ) == 0)
){
char *short_description = gen_short_pkg_description(pkgs->pkgs[iterator]);
printf("%s - %s\n",pkgs->pkgs[iterator]->name,short_description);