summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--scripts/makepkg.sh.in33
1 files changed, 7 insertions, 26 deletions
diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index b30e9d04..d447ddfc 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -1812,7 +1812,6 @@ devel_check() {
# Also do a check to make sure we have the VCS tool available.
local vcs=()
- [[ -n ${_darcstrunk} && -n ${_darcsmod} ]] && vcs+=("darcs")
[[ -n ${_cvsroot} && -n ${_cvsmod} ]] && vcs+=("cvs")
[[ -n ${_gitroot} && -n ${_gitname} ]] && vcs+=("git")
[[ -n ${_svntrunk} && -n ${_svnmod} ]] && vcs+=("svn")
@@ -1833,41 +1832,23 @@ devel_check() {
msg "$(gettext "Determining latest %s revision...")" "$vcs"
+ # Prefix with 'r' if not formatted like a date
case "$vcs" in
- darcs)
- newpkgver=$(date +%Y%m%d)
- ;;
cvs)
- newpkgver=$(date +%Y%m%d)
+ newpkgver=r$(cd $_cvsmod && cvs log -N 2>/dev/null|sed -n 's/revision //p'|sed 1q)
;;
git)
- newpkgver=$(date +%Y%m%d)
+ # Take date down to the minute since git commit IDs aren't numeric/increasing
+ newpkgver=$(date -u +%Y%m%d.%H%M -d "`cd $_gitname && git log -n1 --date=iso --format=format:'%cd'`")
;;
svn)
- newpkgver=$(LC_ALL=C svn info $_svntrunk | sed -n 's/^Last Changed Rev: \([0-9]*\)$/\1/p')
+ newpkgver=r$(LC_ALL=C svn info $_svntrunk | sed -n 's/^Last Changed Rev: \([0-9]*\)$/\1/p')
;;
bzr)
- newpkgver=$(bzr revno ${_bzrtrunk})
+ newpkgver=r$(bzr revno $_bzrtrunk)
;;
hg)
- if pushd "./src/$_hgrepo" > /dev/null; then
- local ret=0
- hg pull || ret=$?
- if (( ! ret )); then
- hg update
- elif (( ret != 1 )); then
- return 1
- fi
- else
- [[ ! -d ./src/ ]] && mkdir ./src/
- hg clone "$_hgroot/$_hgrepo" "./src/$_hgrepo"
- if ! pushd "./src/$_hgrepo" > /dev/null; then
- warning "$(gettext "An error occured while determining the hg version number.")"
- return 0
- fi
- fi
- newpkgver=$(hg tip --template "{rev}")
- popd > /dev/null
+ newpkgver=r$(cd $_hgrepo && hg tip --template "{rev}")
;;
esac