You are not logged in.

#1 2017-12-02 00:12:57

Joel
Member
From: Tijuana, BC, México
Registered: 2011-12-21
Posts: 121

git commit to link with pkgver()

I'd like to make an arch package one of my software hosted on github, I'd like to take advantage of pkgver() function to match the one "commited" on github, but I don't know how to do it, I understand how to declare it in PKGBUILD, but not in my commited git.

Any help, please?


* PC: Intel Core 2 DUO E6550 @ 2.33 GHz with 2 GB RAM: Archlinux-i686 with xfce4.
* Laptop: Intel Core 2 DUO T6600 @ 2.20 GHz with 4 GB RAM: Archlinux-x86-64 with xfce4.
* AUR contributor.

Offline

#2 2017-12-02 00:27:27

progandy
Member
Registered: 2012-05-17
Posts: 5,201

Re: git commit to link with pkgver()

If you wish to create a release with a version number in git, I suggest you create a tag:
https://git-scm.com/book/en/v2/Git-Basics-Tagging
In order to create a standard PKGBUILD, you can then set the pkgver manually and download the archive for that tag.
For a VCS package, the pkgver function can display the tag version and count the commits since that tag.

For github, you can use the "release" function with is built on top of tags
https://help.github.com/articles/about-releases/
https://help.github.com/articles/creating-releases/

Last edited by progandy (2017-12-02 00:29:30)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#3 2017-12-02 00:34:17

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: git commit to link with pkgver()

Moving to Creating Packages...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#4 2017-12-02 00:39:14

Xyne
Administrator/PM
Registered: 2008-08-03
Posts: 6,963
Website

Re: git commit to link with pkgver()

I am not sure that I understand your question. What do you mean by "match" here?

Joel wrote:

take advantage of pkgver() function to match the one "commited" on github

Normally the head of the master branch will be used to build the package. Every time the package is built, makepkg will fetch the last commit (and update the package version in the pkgbuild). If you want to use something else, you can configure the PKGBUILD to check out specific tag or commits or even other branches (read  the VCS section of thethe PKGBUILD man page for details). No changes are needed in the git repo. Everything is configured in the PKGBUILD.

You can tag your commits in the git repo and use a version of pkgver() to include them in the package version but that is not necessary. The wiki page that you linked contains examples of pkgver() functions that will create unique incremental versions by counting commits without using tags.

If this doesn't answer your question, can you give an example of what you are trying to do?


edit
Just to clarify, there are two types of "git" packages.

  1. Packages that follow the HEAD of a branch. These packages include the "-git" suffix. The PKGBUILD will automatically fetch the last commit on the target branch and build it without any intervention.

  2. Stable packages that check out fixed commits from a git repo. These do not use the "-git" suffix. The PKGBUILD will fetch and build a specific version of the package. For example, if you have stable tagged releases (e.g. v3.3) then you could write a PKGBUILD that checks out the tag "v3.3". When a new version is release (e.g. v3.4), the PKGBUILD would need to be updated to checkout the tag "v3.4". Instead of tags, you could use commit hashes to designate specific commits. This can be done using URL fragments as explained in the PKGBUILD man page.

Last edited by Xyne (2017-12-02 00:47:16)


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#5 2017-12-02 01:03:01

Joel
Member
From: Tijuana, BC, México
Registered: 2011-12-21
Posts: 121

Re: git commit to link with pkgver()

Right now, I'm  not in my home town but as soon as possible I will try what @progandy seems to pointed me to the right direction.


* PC: Intel Core 2 DUO E6550 @ 2.33 GHz with 2 GB RAM: Archlinux-i686 with xfce4.
* Laptop: Intel Core 2 DUO T6600 @ 2.20 GHz with 4 GB RAM: Archlinux-x86-64 with xfce4.
* AUR contributor.

Offline

Board footer

Powered by FluxBB