diff options
author | Seppia <seppia@seppia.net> | 2018-06-03 13:41:04 +0200 |
---|---|---|
committer | Seppia <seppia@seppia.net> | 2018-06-03 13:41:04 +0200 |
commit | b3af000e629971b609e9bc41887a81505776a83c (patch) | |
tree | e39764ceff30e46336cda16a029bbb684269fd2d | |
parent | ac177952ab96a624c8256a2a7f634e3d3be7a7fe (diff) | |
download | repofish-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-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 |