Hello again. Here is a patch that implements the third approach (a function called "update"). I kept the rest of devel_check(), so you can test it without breaking support for other PKGBUILDS. Benjamin Richter - - - - - - 0001-makepkg-call-update-in-devel_check.patch - - - - - -
From 21ee2c4c75e7618b2d34057900e8112259e54c9c Mon Sep 17 00:00:00 2001 From: Benjamin Richter <webmaster@waldteufel-online.net> Date: Mon, 17 Aug 2009 13:09:54 +0200 Subject: [PATCH] makepkg: call update() in devel_check()
This allows the PKGBUILD to define a function update() which is called in devel_check(). Thus, svn/cvs/...-PKGBUILDS can specify by themselves how the package version should be computed and other SCM systems can be used easily. It is also possible to retrieve the latest revision in update() like it already happens with hg repositories when $_hgroot and $_hgrepo are set. Signed-off-by: Benjamin Richter <webmaster@waldteufel-online.net> --- scripts/makepkg.sh.in | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index daa9585..de51a22 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -1208,7 +1208,12 @@ devel_check() { # number to avoid having to determine the version number twice. # Also do a brief check to make sure we have the VCS tool available. oldpkgver=$pkgver - if [ -n "${_darcstrunk}" -a -n "${_darcsmod}" ] ; then + if [ "$(type -t update)" == "function" ]; then + msg "$(gettext "Retrieving latest revision...")" + cd "$srcdir" + update + cd "$startdir" + elif [ -n "${_darcstrunk}" -a -n "${_darcsmod}" ] ; then [ $(type -p darcs) ] || return 0 msg "$(gettext "Determining latest darcs revision...")" newpkgver=$(date +%Y%m%d) -- 1.6.4