diff options
-rwxr-xr-x | gen-perl-pkg | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/gen-perl-pkg b/gen-perl-pkg index 59d76d3..1e34216 100755 --- a/gen-perl-pkg +++ b/gen-perl-pkg @@ -4,7 +4,7 @@ set -e for pkg in "$@"; do export MAINTAINER="Florian Pritz <bluewind@xinu.at>" targets=(~/arch/{community,extra}) - target_community=~/arch/community + target_new=~/arch/community found_pkg=0 genpkg "$pkg" @@ -17,7 +17,15 @@ for pkg in "$@"; do done if ((!found_pkg)); then + if [[ $PWD =~ ($HOME/arch/(community|extra)).* ]]; then + target_new="${BASH_REMATCH[1]}" + echo "Found target directory $target_new" + fi + + echo "Package not found, creating new in '$target_new/$pkg/trunk'" mkdir -p "$target/$pkg/"{trunk,repos} - cp "$HOME/pkg/dest/$pkg/PKGBUILD" "$target_community/$pkg/trunk/" + cp "$HOME/pkg/dest/$pkg/PKGBUILD" "$target_new/$pkg/trunk/" + cd "$target_new" + svn add "$pkg" fi done |