From b3af000e629971b609e9bc41887a81505776a83c Mon Sep 17 00:00:00 2001 From: Seppia Date: Sun, 3 Jun 2018 13:41:04 +0200 Subject: Support build multiple packages Added supoprt for building multiple packages with just one command. --- repo.sh | 18 ++++++++++++------ 1 file 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 -- cgit v1.2.3