Compare commits

...

2 Commits
0.9.3 ... 0.9.4

Author SHA1 Message Date
Pierre Schmitz
371f57b043 Don't check if package was released already
The checks aren't reliable enough and fail if the local repo is broken due to
network failures. So for now we just allways commit.
2010-02-22 19:11:17 +01:00
Pierre Schmitz
2fe5dbf904 be more fail safe 2010-02-22 08:13:43 +01:00

View File

@@ -1,42 +1,34 @@
#!/bin/bash
if [ "$1" = '' ]; then
echo 'Usage: archrelease <repo>'
abort() {
echo ${1:-'archrelease: Cancelled'}
exit 1
}
if [ "$1" = '' ]; then
abort 'Usage: archrelease <repo>'
fi
if [ ! -f PKGBUILD ]; then
echo 'archrelease: PKGBUILD not found'
exit 1
abort 'archrelease: PKGBUILD not found'
fi
if [ "$(basename $(readlink -f .))" != 'trunk' ]; then
echo 'archrelease: Not in a package trunk dir'
exit 1
abort 'archrelease: Not in a package trunk dir'
fi
if [ ! -z "$(svn status -q)" ]; then
echo 'archrelease: You have not committed your changes yet!'
echo ' Please run "svn commit" first'
exit 1
abort 'archrelease: You have not committed your changes yet!'
fi
echo -n 'releasing package...'
pushd .. >/dev/null
trunk=$(svnversion -cn trunk | cut -f1 -d:)
repo=$(svnversion -cn "repos/${1}" 2>/dev/null | cut -f1 -d:)
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}"
svn commit -q -m "archrelease: remove ${1}" || abort
fi
svn copy -q -r HEAD trunk "repos/${1}"
svn commit -q -m "archrelease: copy trunk to ${1}"
svn commit -q -m "archrelease: copy trunk to ${1}" || abort
popd >/dev/null
echo 'done'