summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xrepo.sh18
1 files changed, 12 insertions, 6 deletions
diff --git a/repo.sh b/repo.sh
index edf5d0f..e37984a 100755
--- a/repo.sh
+++ b/repo.sh
@@ -64,8 +64,11 @@ clean_packages() {
build_packages() {
if [ "$1" != '' ]; then
- cd $(find ${SRC_PATH}/* -type d -prune -iname "*$1")
- makepkg -Cs
+ declare -a pkg=("${!1}")
+ for i in "${pkg[@]}"; do
+ cd $(find ${SRC_PATH}/* -type d -prune -iname "*$i")
+ makepkg -Cs
+ done
else
for i in $(find ${SRC_PATH}/* -type d -prune)
do
@@ -234,10 +237,13 @@ elif [ "$1" == 'update' ]; then
update_repo
fi
elif [ "$1" == 'build' ]; then
- if [ "$3" != '' ]; then
- echo 'ERROR: too many arguments.'
- elif [ "$2" != '' ]; then
- build_packages $2
+ if [ "$2" != '' ]; then
+ N=2
+ while [ "${!N}" != '' ]; do
+ packages[$((N-2))]=${!N}
+ let N=N+1
+ done
+ build_packages packages[@]
else
build_packages
fi