[[Wikipedia:Revision_control|Version control systems]] can be used for retrieval of source code for both usual statically versioned packages and latest (trunk) version of packages. This article covers both cases.

+

[[Wikipedia:Revision_control|Version control systems]] can be used for retrieval of source code for both usual statically versioned packages and latest (trunk) version of a development branch. This article covers both cases.

To make sure that there are no VCS leftovers use the following at the end of the {{ic|package()}} function (replacing {{ic|'''.git'''}} with {{ic|.svn}}, {{ic|.hg}}, etc.):

−

find "$pkgdir" -type d -name '''.git''' -exec rm -r '{}' +

−

−

=== SVN packages that try to get their revision number ===

−

If the build system for the program you are packaging calls {{ic|svnversion}} or {{ic|svn info}} to determine its revision number, you can add a {{ic|prepare()}} function similar to this one to make it work:

−

−

prepare() {

−

cp -a "$SRCDEST/$_svnmod/.svn" "$srcdir/$_svnmod/"

−

}

−

−

== Troubleshooting ==

−

−

=== Bazaar limitation ===

−

Currently, only one type of bazaar URLs can be used in the source array, which format is specific to the host. For example, Launchpad URLs will need to start with {{ic|http://bazaar.launchpad.net/}}, e.g.:

VCS sources

Note: Pacman 4.1 supports the following VCS sources: bzr, git, hg and svn. See the fragment section of man PKGBUILD or PKGBUILD(5) for a list of supported VCS.

Starting with pacman 4.1, the VCS sources should be specified in the source=() array and will be treated like any other source. makepkg will clone/checkout/branch the repo into $SRCDEST (same as $startdir if not set in makepkg.conf(5)) and copy it to $srcdir (in a specific way to each VCS). The local repo is left untouched, thus invalidating the need for a -build directory.

The general format of a VCS source=() array is:

source=('[folder::][vcs+]url[#fragment]')

folder (optional) is used to change the default repo name to something more relevant (e.g. than trunk) or to preserve the previous sources

vcs+ is needed for URLs that do not reflect the VCS type, e.g. git+http://some_repo.

The pkgver() function

The pkgver autobump is now achieved via a dedicated pkgver() function. This allows for better control over the pkgver, and maintainers should favor a pkgver that makes sense. Following are some examples showing the intended output: