devtools/archrelease

34 lines
713 B
Plaintext
Raw Normal View History

#!/bin/bash
2010-02-22 08:13:43 +01:00
abort() {
echo ${1:-'archrelease: Cancelled'}
2010-02-13 19:47:16 +01:00
exit 1
2010-02-22 08:13:43 +01:00
}
if [ "$1" = '' ]; then
abort 'Usage: archrelease <repo>'
fi
if [ ! -f PKGBUILD ]; then
2010-02-22 08:13:43 +01:00
abort 'archrelease: PKGBUILD not found'
fi
2010-02-13 19:47:16 +01:00
if [ "$(basename $(readlink -f .))" != 'trunk' ]; then
2010-02-22 08:13:43 +01:00
abort 'archrelease: Not in a package trunk dir'
fi
if [ ! -z "$(svn status -q)" ]; then
2010-02-22 08:13:43 +01:00
abort 'archrelease: You have not committed your changes yet!'
fi
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
2010-02-17 15:24:54 +01:00
fi
svn copy -q -r HEAD trunk "repos/${1}"
svn commit -q -m "archrelease: copy trunk to ${1}" || abort
popd >/dev/null
echo 'done'