diff options
author | Florian Pritz <bluewind@xinu.at> | 2018-02-11 10:05:24 +0100 |
---|---|---|
committer | Florian Pritz <bluewind@xinu.at> | 2018-02-11 10:05:24 +0100 |
commit | 53b07ce184591049190884e7ffc5d26aa069f7e3 (patch) | |
tree | 9616f7238c0c93915e2eacafa7ec28d1ad0a29c4 /gen-perl-pkg | |
parent | 145dca1437b1fd548eb9cc6dc2643ea3d572a880 (diff) | |
download | bin-53b07ce184591049190884e7ffc5d26aa069f7e3.tar.gz bin-53b07ce184591049190884e7ffc5d26aa069f7e3.tar.xz |
gen-perl-pkg: Support extra packages
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'gen-perl-pkg')
-rwxr-xr-x | gen-perl-pkg | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/gen-perl-pkg b/gen-perl-pkg index 026ca16..59d76d3 100755 --- a/gen-perl-pkg +++ b/gen-perl-pkg @@ -3,13 +3,21 @@ set -e for pkg in "$@"; do export MAINTAINER="Florian Pritz <bluewind@xinu.at>" - target=~/arch/community - - genpkg $pkg - mkdir -p "$target/$pkg/"{trunk,repos} - if [[ -f "$target/$pkg/trunk/PKGBUILD" ]]; then - vimdiff "$HOME/pkg/dest/$pkg/PKGBUILD" "$target/$pkg/trunk/PKGBUILD" - else - cp "$HOME/pkg/dest/$pkg/PKGBUILD" "$target/$pkg/trunk/" + targets=(~/arch/{community,extra}) + target_community=~/arch/community + found_pkg=0 + + genpkg "$pkg" + + for target in "${targets[@]}"; do + if [[ -f "$target/$pkg/trunk/PKGBUILD" ]]; then + found_pkg=1 + vimdiff "$HOME/pkg/dest/$pkg/PKGBUILD" "$target/$pkg/trunk/PKGBUILD" + fi + done + + if ((!found_pkg)); then + mkdir -p "$target/$pkg/"{trunk,repos} + cp "$HOME/pkg/dest/$pkg/PKGBUILD" "$target_community/$pkg/trunk/" fi done |