[arch-projects] [devtools] [PATCH 1/4] archrelease: Remove redundant directory check
Signed-off-by: Lukas Fleischer
Ensure we do not mess with version control if there are any
subdirectories in the package trunk.
Signed-off-by: Lukas Fleischer
This allows for releasing to multiple repositories with a single
archrelease invocation, while keeping separate commits:
----
$ archrelease community-{i686,x86_64}
releasing package to community-i686...done
releasing package to community-x86_64...done
----
Signed-off-by: Lukas Fleischer
On Fri, Aug 19, 2011 at 3:16 AM, Lukas Fleischer
This allows for releasing to multiple repositories with a single archrelease invocation, while keeping separate commits: Isn't this a perfect example of where we would want a single atomic commit? I like the multiple tags idea, but it seems we should also combine the commits as well.
---- $ archrelease community-{i686,x86_64} releasing package to community-i686...done releasing package to community-x86_64...done ----
Signed-off-by: Lukas Fleischer
--- archrelease | 39 +++++++++++++++++++++++---------------- 1 files changed, 23 insertions(+), 16 deletions(-) diff --git a/archrelease b/archrelease index 0fb3445..c175d2d 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,27 @@ 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 "releasing package to ${tag}..." + + if [[ -d repos/$tag ]]; then + declare -a 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 + + svn commit -q -m "archrelease: copy trunk to $tag" || abort + + echo 'done' done -svn commit -q -m "archrelease: copy trunk to ${1}" || abort popd >/dev/null -echo 'done' -- 1.7.6
On Fri, Aug 19, 2011 at 06:55:56AM -0500, Dan McGee wrote:
On Fri, Aug 19, 2011 at 3:16 AM, Lukas Fleischer
wrote: This allows for releasing to multiple repositories with a single archrelease invocation, while keeping separate commits: Isn't this a perfect example of where we would want a single atomic commit? I like the multiple tags idea, but it seems we should also combine the commits as well.
Well, I wasn't so sure when I wrote this. You could also declare releasing a package to a single repository as atomic. The idea is that there might be situations when we want to release to a single architecture only and that you might want to revert a single architecture release if you accidentally released to the wrong repository (like core-i686 and extra-x86_64). I know that this is quite a stretch, though... If we actually define a package as broken if it supports i686, as well as x86_64, and is released to i686 only, you're probably right.
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
Suggest multiple tags when using ZSH completion with archrelease.
Signed-off-by: Lukas Fleischer
Make use of archrelease's multi-tag capability invoke it once instead of
re-launching it for for each individual tag.
Signed-off-by: Lukas Fleischer
participants (2)
-
Dan McGee
-
Lukas Fleischer