diff options
author | Lukas Fleischer <archlinux@cryptocrack.de> | 2011-08-20 22:18:48 +0200 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2011-08-25 11:13:45 +0200 |
commit | 6ef4d5f30b618d88d2f9f4c30e572eeebcffadeb (patch) | |
tree | 4914f0ed086b75da60b02df68056e4e2799b43d2 /archrelease | |
parent | 40ddf4d44f2d41048ac1543a57feba9d2cf57155 (diff) | |
download | devtools-6ef4d5f30b618d88d2f9f4c30e572eeebcffadeb.tar.xz |
archrelease: Accept multiple tags
This allows for releasing to multiple repositories with a single commit:
----
$ archrelease community-{i686,x86_64}
copying trunk to community-i686...done
copying trunk to community-x86_64...done
releasing package...done
----
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
Diffstat (limited to 'archrelease')
-rwxr-xr-x | archrelease | 44 |
1 files changed, 28 insertions, 16 deletions
diff --git a/archrelease b/archrelease index 0fb3445..287c5e7 100755 --- a/archrelease +++ b/archrelease @@ -6,7 +6,7 @@ abort() { } if [[ -z $1 ]]; then - abort 'Usage: archrelease <repo>' + abort 'Usage: archrelease <repo>...' fi # TODO: validate repo is really repo-arch @@ -29,7 +29,6 @@ if [[ $(svn status -q) ]]; then abort 'archrelease: You have not committed your changes yet!' fi -echo -n "releasing package to ${1}..." pushd .. >/dev/null IFS=$'\n' read -r -d '' -a known_files < <(svn ls "trunk") for file in "${known_files[@]}"; do @@ -37,19 +36,32 @@ for file in "${known_files[@]}"; do abort "archrelease: subdirectories are not supported in package directories!" fi done -if [[ -d repos/$1 ]]; then - declare -a trash - while read -r file; do - trash+=("repos/$1/$file") - done < <(svn ls "repos/$1") - svn rm -q "${trash[@]}" -else - mkdir -p "repos/${1}" - svn add --parents -q "repos/${1}" -fi -for file in "${known_files[@]}"; do - svn copy -q -r HEAD "trunk/$file" "repos/${1}/" + +for tag in "$@"; do + echo -n "copying trunk to ${tag}..." + + if [[ -d repos/$tag ]]; then + declare -a trash + trash=() + while read -r file; do + trash+=("repos/$tag/$file") + done < <(svn ls "repos/$tag") + svn rm -q "${trash[@]}" + else + mkdir -p "repos/$tag" + svn add --parents -q "repos/$tag" + fi + + for file in "${known_files[@]}"; do + svn copy -q -r HEAD "trunk/$file" "repos/$tag/" + done + + echo 'done' done -svn commit -q -m "archrelease: copy trunk to ${1}" || abort -popd >/dev/null + +echo -n "releasing package..." +printf -v tag_list ", %s" "$@"; tag_list="${tag_list#, }" +svn commit -q -m "archrelease: copy trunk to $tag_list" || abort echo 'done' + +popd >/dev/null |