You are not logged in.
Hi there,
I wonder whether it is possible to use a certain Git commit in the source array of a package.
Example:
For debugging purposes I would like to use the commit
8ff0bd0282205802c482c7d47f216feb0d3394a9
I tried the following in the source array and it successfully built the package:
source=('git://github.com/i-rinat/freshplayerplugin.git#commit=8ff0bd0282205802c482c7d47f216feb0d3394a9')
However, I have no idea how to detect whether it actually built from the specific commit or just skipped the #commit appending.
Does anyone know how to source a specific commit?
Thanks ahead!
Last edited by orschiro (2014-07-17 11:21:17)
Offline
Correct syntax for Git repository as a source would be:
source=('git+https://<repo-url>#[commit|tag|branch]=<ref>')
To verify it's building correct tree, and moreover to keep sane when dealing with multiple trees I like following pkgver (check https://wiki.archlinux.org/index.php/VC … Guidelines):
pkgver() {
cd "$srcdir/<repo-name>"
printf 'r%s.%s' "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}
producing something like:
<package-name-git>-r4.34e558d-1-any.pkg.tar.xz
Also just going to fetched Git tree and checking out what's there is an option (look for makepkg branch), for example:
$ git show-ref
34e558d2ef8b2cae212da3ab3f74513a99f9ee1b refs/heads/makepkg
86350ab5a3a209de4339ef04d75d27c7bd399746 refs/heads/master
86350ab5a3a209de4339ef04d75d27c7bd399746 refs/remotes/origin/HEAD
86350ab5a3a209de4339ef04d75d27c7bd399746 refs/remotes/origin/master
Last edited by mkoskar (2014-07-17 09:13:11)
Offline
One way would be to do
git checkout
in the build function.
Offline
Since we're talking about git tags and PKGBUILD pkgver functions, excelent examples are listed in the wiki.
For example
Using the most recent un-annotated tag reachable from the last commit:
pkgver() { cd "$pkgname" git describe --long --tags | sed -r 's/([^-]*-g)/r\1/;s/-/./g' }
I guess that I'll need to pick up a little sed, now.
UPDATE: Since the linked wiki page has a note about out of date prototypes, here is the Manjaro wiki with excelent git prototype.
Last edited by bartonc (2014-11-10 04:01:22)
Offline