mirror of
https://gitlab.archlinux.org/archlinux/devtools.git
synced 2025-09-17 20:06:19 +02:00
Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
371f57b043 | ||
![]() |
2fe5dbf904 |
30
archrelease
30
archrelease
@@ -1,42 +1,34 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
if [ "$1" = '' ]; then
|
abort() {
|
||||||
echo 'Usage: archrelease <repo>'
|
echo ${1:-'archrelease: Cancelled'}
|
||||||
exit 1
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
if [ "$1" = '' ]; then
|
||||||
|
abort 'Usage: archrelease <repo>'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -f PKGBUILD ]; then
|
if [ ! -f PKGBUILD ]; then
|
||||||
echo 'archrelease: PKGBUILD not found'
|
abort 'archrelease: PKGBUILD not found'
|
||||||
exit 1
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$(basename $(readlink -f .))" != 'trunk' ]; then
|
if [ "$(basename $(readlink -f .))" != 'trunk' ]; then
|
||||||
echo 'archrelease: Not in a package trunk dir'
|
abort 'archrelease: Not in a package trunk dir'
|
||||||
exit 1
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -z "$(svn status -q)" ]; then
|
if [ ! -z "$(svn status -q)" ]; then
|
||||||
echo 'archrelease: You have not committed your changes yet!'
|
abort 'archrelease: You have not committed your changes yet!'
|
||||||
echo ' Please run "svn commit" first'
|
|
||||||
exit 1
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo -n 'releasing package...'
|
echo -n 'releasing package...'
|
||||||
pushd .. >/dev/null
|
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
|
if [ -d "repos/${1}" ]; then
|
||||||
svn rm --force -q "repos/${1}"
|
svn rm --force -q "repos/${1}"
|
||||||
svn commit -q -m "archrelease: remove ${1}"
|
svn commit -q -m "archrelease: remove ${1}" || abort
|
||||||
fi
|
fi
|
||||||
svn copy -q -r HEAD trunk "repos/${1}"
|
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
|
popd >/dev/null
|
||||||
echo 'done'
|
echo 'done'
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user