You are not logged in.
Please forgive my english and my inexperience, this is my first AUR package release.
I released this package (only PKGBUILD and .SRCINFO):
https://aur.archlinux.org/packages/jgmenu-git
The package installs without problem, but it is reinstalled at every update.
The only strange things are these strings after compilation:
<command-line>: warning: "VERSION" redefined
<command-line>: note: this is the location of the previous definition
<command-line>: warning: "VERSION" redefined
<command-line>: note: this is the location of the previous definition
<command-line>: warning: "VERSION" redefined
<command-line>: note: this is the location of the previous definition
<command-line>: warning: "VERSION" redefined
<command-line>: note: this is the location of the previous definition
<command-line>: warning: "VERSION" redefined
<command-line>: note: this is the location of the previous definition
<command-line>: warning: "VERSION" redefined
<command-line>: note: this is the location of the previous definition
<command-line>: warning: "VERSION" redefined
<command-line>: note: this is the location of the previous definitionAs suggested by wiki i used this function:
pkgver() {
cd "$pkgname"
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}but online code during installation show this output:
r1483.c258a6c-1
the original git and the package downloaded form AUR instead show this:
r4.b375817
Tx for any suggestions
Offline
You didn't properly regenerate the .SRCINFO before uploading to the AUR. The .SRCINFO file has the version as 4.4.0 while the PKGBUILD static value is v4.4.0, and then the pkgver function generates a value starting witht the letter r which will always be less than both the 4.4.0 and the v4.4.0. You need to chose a versioning scheme and use it consistently. What you have in the pkgver function looks good. If you run makepkg once on that PKGBUILD the static value in the PKGBUILD will be properly replaced, then manually set the pkgrel back to 1, then regenerate the .SRCINFO file, and then commit both files to the AUR.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
If tag contains a prefix, like v or project name then it should be cut off:
pkgver() { cd "$pkgname" # cutting off 'foo-' prefix that presents in the git tag git describe --long | sed 's/^foo-//;s/\([^-]*-g\)/r\1/;s/-/./g' }6.1.r3.gd77e105
Last edited by yochananmarqos (2022-04-06 18:02:39)
Online
Thanks for all suggestions.
Now the package does not require to be ever updated .
The warning about " version redefined" during installation still persist.
Searching google for this message using quotes around it point only to this forum thread.
Offline
If you run makepkg once on that PKGBUILD the static value in the PKGBUILD will be properly replaced, then manually set the pkgrel back to 1, then regenerate the .SRCINFO file, and then commit both files to the AUR.
You seem to have skipped most of this. You manually put something in the pkgver field of the PKGBUILD that even includes the pkgname. Really, start by running makepkg once, that will fix the pkgver in the PKGBUILD. Then regenerate the .SRCINFO file, then commit and push to the AUR.
EDIT: Also you changed your pkgver function, but it still doesn't match any of the recommended approaches. Please follow the examples in the wiki. This should be your pkgver function:
pkgver() {
cd "${srcdir}/${_pkgname}"
git describe --long | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}Last edited by Trilby (2022-04-04 18:55:28)
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
You seem to have skipped most of this. You manually put something in the pkgver field of the PKGBUILD that even includes the pkgname. Really, start by running makepkg once, that will fix the pkgver in the PKGBUILD. Then regenerate the .SRCINFO file, then commit and push to the AUR.
EDIT: Also you changed your pkgver function, but it still doesn't match any of the recommended approaches.
I was running the functions in the package dir, not in the $srcdir, obtaining obviously a different value from the one required by AUR
So i copied another function from AUR that provide the right version code.
I understood my error but i haven't enough time to correct the PKGBUILD until now. I will change it as soon as i will send this post
.
My git does not have tag so i prefer this code
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"It is not necessary run makepkg every time the git code change, it is sufficient to run the code above in the source dir to obtain the correct value that can be pasted in PKGBUILD.
Offline
My git does not have tag
There are tags in the source repo listed in the PKGBUILD.
It is not necessary run makepkg every time the git code change, it is sufficient to run the code above in the source dir to obtain the correct value that can be pasted in PKGBUILD.
NO. Do not manually run this code; do not manually paste anything into the pkgver value in the PKGBUILD. Use makepkg, it will adjust the pkgver value for you.
But you are correct that you do not do this every time the git code changes. You do this once to get a valid PKGBUILD and .SRCINFO, then upload them to the AUR. After that a VCS PKGBUILD might never need to be updated again (the package can be updated, but the PKGBUILD in the AUR remains the same).
Last edited by Trilby (2022-04-06 19:13:00)
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
But you are correct that you do not do this every time the git code changes. You do this once to get a valid PKGBUILD and .SRCINFO, then upload them to the AUR. After that a VCS PKGBUILD might never need to be updated again (the package can be updated, but the PKGBUILD in the AUR remains the same).
Thanks Tribly, for sure i must study more deeply the AUR documentation in the wiki.
And thanks also for your willingness.
Offline