diff options
-rwxr-xr-x | repo.sh | 18 |
1 files changed, 12 insertions, 6 deletions
@@ -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 |