devtools/archrelease

45 lines
1.1 KiB
Plaintext
Raw Normal View History

#!/bin/bash
2010-02-13 19:47:16 +01:00
if [ "$1" = '' ]; then
echo 'Usage: archrelease <repo>'
exit 1
fi
if [ ! -f PKGBUILD ]; then
2010-02-13 19:47:16 +01:00
echo 'archrelease: PKGBUILD not found'
exit 1
fi
2010-02-13 19:47:16 +01:00
if [ "$(basename $(readlink -f .))" != 'trunk' ]; then
echo 'archrelease: Not in a package trunk dir'
exit 1
fi
if [ ! -z "$(svn status -q)" ]; then
2010-02-13 19:47:16 +01:00
echo 'archrelease: You have not committed your changes yet!'
echo ' Please run "svn commit" first'
exit 1
fi
echo -n 'releasing package...'
pushd .. >/dev/null
2010-02-17 18:27:09 +01:00
trunk=$(svnversion -cn trunk | cut -f1 -d:)
repo=$(svnversion -cn "repos/${1}" 2>/dev/null | cut -f1 -d:)
if [[ ${trunk} -le ${repo} ]]; then
2010-02-17 15:24:54 +01:00
echo 'already done'
exit 1
fi
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}"
popd >/dev/null
echo 'done'
2010-02-13 19:47:16 +01:00
# vim: set noexpandtab tabstop=8 shiftwidth=8 wrap:textwidth=132 autoindent
# kate: indent-mode normal; indent-width 8; tab-indents on; tab-width 8; word-wrap on; word-wrap-column 132