cross-posted from: https://lemmy.ml/post/53225512
I want to create and upload an AUR package. For context, I did that years ago for specific releases, but now I want to create a new package that focuses on upstream Git without specific releases.
What do I write to the
pkgver=value? Do I just take the latest version there? Because it is downloading withgit clonethe version number will not change and the PKGBUILD script will comparepkgver()instead. So what is the purpose ofpkgver=for when downloading and building from Git directly? Looking at examples from other existing packages, they all have a number there. But its mostly outdated, so I don’t get it.pkgname=thename-git _pkgname="$(pkgname%-git}" pkgver=??? pkgver() { cd "${_pkgname}" git describe --long | sed 's/\([^-]*-g\)/r\1/' }I am reading and researching, but need some assistance for this question. Currently reading the Archwiki:


from a package that I installed I saw that it has semver+githash of latest commit
The thing is, when installing a -git package, then the function
pkgver()is used to extract a version number to compare if its newer than what you have installed. And this is normally as you saw semver+githash. My question is, what do I write topkgver=variable, that seemingly get ignored. But for whatever reason there is a version number listed on all -git packages. I’m just confused what I have to write there in an initial upload. It’s important to distinguish between the variable and the function. This is a specific AUR thing and I could not get the information from the documentation.The pkgver is replaced by makepkg with the value of pkgver(). Similar to how updpkgsums updates the hashes.
I understand that. But I don’t understand why everyone else has an outdated version number. I felt like I’m missing something here. Maybe its just a placeholder that is completely ignored with -git packages then.
Who are you talking about? If it’s AUR uploaders, the version you see is the version in the last uploaded
PKGBUILD. AUR itself doesn’t build anything. AndPKGBUILDuploaders don’t need to keep uploading to bump the version because it auto-updates when a user builds it. They only need to upload to fix builds if they get broken, or update meta info, …etc.git (vcs in general) packages always update unless you pass
--holdverwithmakepkg.And just to be clear, that relates to git sources not the package name. The
-gitnaming is just a convention that has no bearing on functionality.Mostly yes. You can just put “0” or “1” initially. Build once, and it will be populated anyway.