aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58>2006-12-10 17:56:31 +0000
committerrhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58>2006-12-10 17:56:31 +0000
commit179fb5c1851016037fb4abde0a6201949a728ca7 (patch)
tree131979aa8380085eaff3a3ef9cb6b4a5baab1320 /src
parent8b4a99525139377d9334ff200cef331e16416617 (diff)
downloadsimplepkg-179fb5c1851016037fb4abde0a6201949a728ca7.tar.gz
simplepkg-179fb5c1851016037fb4abde0a6201949a728ca7.tar.bz2
simplaret: can list all packages by a --search with no arguments
git-svn-id: svn+slack://slack.fluxo.info/var/svn/simplepkg@62 04377dda-e619-0410-9926-eae83683ac58
Diffstat (limited to 'src')
-rwxr-xr-xsrc/simplaret20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/simplaret b/src/simplaret
index 25d3785..19e1ad6 100755
--- a/src/simplaret
+++ b/src/simplaret
@@ -226,9 +226,13 @@ function simplaret_update {
function simplaret_find_package {
# grep packages in a repository's file list
- # usage: simplaret_find_package <package-name> <repository-folder>
+ # usage: simplaret_find_package <package-name|-all> <repository-folder>
- grep $1 $2/`simplaret_filelist` | awk '{ print $8 }' | grep -e ".tgz$"
+ if [ "$1" == "-all" ]; then
+ grep -e ".tgz$" $2/`simplaret_filelist` | awk '{ print $8 }'
+ else
+ grep $1 $2/`simplaret_filelist` | awk '{ print $8 }' | grep -e ".tgz$"
+ fi
}
@@ -275,7 +279,13 @@ function simplaret_metafiles {
function simplaret_search {
- local priority message
+ local priority message pattern
+
+ if [ ! -z "$1" ]; then
+ pattern="$1"
+ else
+ pattern="-all"
+ fi
for repos_type in patches root repos noarch; do
@@ -301,12 +311,12 @@ function simplaret_search {
if [ "$repos_type" == "root" ]; then
# root repositories has ROOT_PRIORITY
for priority in $ROOT_PRIORITY; do
- for file in `simplaret_find_package $1 $storage/$repository_name | grep "/$priority/"`; do
+ for file in `simplaret_find_package $pattern $storage/$repository_name | grep "/$priority/"`; do
simplaret_show_package $file $2
done
done
else
- for file in `simplaret_find_package $1 $storage/$repository_name`; do
+ for file in `simplaret_find_package $pattern $storage/$repository_name`; do
simplaret_show_package $file $2
done
fi