summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSeppia <seppia@seppia.net>2018-06-03 13:41:04 +0200
committerSeppia <seppia@seppia.net>2018-06-03 13:41:04 +0200
commitb3af000e629971b609e9bc41887a81505776a83c (patch)
treee39764ceff30e46336cda16a029bbb684269fd2d
parentac177952ab96a624c8256a2a7f634e3d3be7a7fe (diff)
downloadrepofish-b3af000e629971b609e9bc41887a81505776a83c.tar.gz
repofish-b3af000e629971b609e9bc41887a81505776a83c.tar.bz2
repofish-b3af000e629971b609e9bc41887a81505776a83c.zip
Support build multiple packages
Added supoprt for building multiple packages with just one command.
-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