aboutsummaryrefslogtreecommitdiff
path: root/src/simplaret
diff options
context:
space:
mode:
Diffstat (limited to 'src/simplaret')
-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