diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2010-02-17 18:05:16 +0100 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2010-02-17 18:05:16 +0100 |
commit | 53a864a5aa2e273154e4e37218b967924cf4cf79 (patch) | |
tree | 8353f043df3bd582c685671e81f5ca3038dcad10 /archrelease | |
parent | 849e6c6de51415888146f2def34b5264bccffb7a (diff) |
Use local information to determine if a commit is needed
Diffstat (limited to 'archrelease')
-rwxr-xr-x | archrelease | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/archrelease b/archrelease index 70845a6..c9f32cb 100755 --- a/archrelease +++ b/archrelease @@ -15,7 +15,7 @@ if [ "$(basename $(readlink -f .))" != 'trunk' ]; then exit 1 fi -if [ "$(svn diff)" != '' ]; then +if [ ! -z "$(svn status -q)" ]; then echo 'archrelease: You have not committed your changes yet!' echo ' Please run "svn commit" first' exit 1 @@ -23,18 +23,20 @@ fi echo -n 'releasing package...' pushd .. >/dev/null -url=$(svn info | grep URL) -url="${url##*URL: }" -if [ -z "$(svn diff ${url}/trunk ${url}/repos/${1} 2>/dev/null)" -a $? -eq 0 ]; then + +trunk=$(LANG=C svn info trunk | grep 'Last Changed Rev:' | awk '{ print $4 }') +repo=$(LANG=C svn info "repos/${1}" 2>/dev/null | grep 'Last Changed Rev:' | awk '{ print $4 }') +if [[ ${trunk} -le ${repo} ]]; then echo 'already done' exit 1 fi -if [ -d repos/$1 ]; then - svn rm --force -q repos/$1 - svn commit -q -m "archrelease: remove $1" + +if [ -d "repos/${1}" ]; then + svn rm --force -q "repos/${1}" + svn commit -q -m "archrelease: remove ${1}" fi -svn copy -q -r HEAD trunk repos/$1 -svn commit -q -m "archrelease: copy trunk to $1" +svn copy -q -r HEAD trunk "repos/${1}" +svn commit -q -m "archrelease: copy trunk to ${1}" popd >/dev/null echo 'done' |