Skip to content
archrelease 748 B
Newer Older
Pierre Schmitz's avatar
Pierre Schmitz committed
abort() {
	echo ${1:-'archrelease: Cancelled'}
	exit 1
Pierre Schmitz's avatar
Pierre Schmitz committed
}

if [ "$1" = '' ]; then
	abort 'Usage: archrelease <repo>'
if [ ! -f PKGBUILD ]; then
Pierre Schmitz's avatar
Pierre Schmitz committed
	abort 'archrelease: PKGBUILD not found'
trunk=$(basename $(pwd))

if [ "$(basename $(dirname $(pwd)))" == "repos" ]; then
Pierre Schmitz's avatar
Pierre Schmitz committed
	abort 'archrelease: Not in a package trunk dir'
if [ ! -z "$(svn status -q)" ]; then
Pierre Schmitz's avatar
Pierre Schmitz committed
	abort 'archrelease: You have not committed your changes yet!'
echo -n 'releasing package...'
pushd .. >/dev/null
if [ -d "repos/${1}" ]; then
	svn rm --force -q "repos/${1}"
	svn commit -q -m "archrelease: remove ${1}" || abort
svn copy -q -r HEAD "${trunk}" "repos/${1}"
svn commit -q -m "archrelease: copy ${trunk} to ${1}" || abort
popd >/dev/null
echo 'done'