You are not logged in.

#1 2022-07-28 14:35:12

berk
Member
Registered: 2022-07-28
Posts: 4

Auto Update Yay Package Version

Hi everybody, a newbie here. I made a package for a git repository that still get commits and new releases. And I may forget or not be able to update my aur repository to the new version. Is there a way to auto update the package version in the PKGBUILD file when a commit is pushed to master branch?

Offline

#2 2022-07-28 15:07:22

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,449
Website

Re: Auto Update Yay Package Version

There is no need to do so.  If the PKGBUILD in question is written properly (according to the VCS guidelines) then just leave it be.  You should not push updates to the aur for every single commit on the upstream VCS.  Users of the package will still get the most up to date code any time they build it (and makepkg will locally update the pkgver at that time).

EDIT: if you are "berk" on the AUR too, then it looks like you have two packages, bot -git packages, but only one properly follows the VCS package guidelines (yet the other has been updated very recently and hasn't been fixed).

Last edited by Trilby (2022-07-28 15:11:04)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#3 2022-07-28 16:36:03

berk
Member
Registered: 2022-07-28
Posts: 4

Re: Auto Update Yay Package Version

Trilby wrote:

There is no need to do so.  If the PKGBUILD in question is written properly (according to the VCS guidelines) then just leave it be.  You should not push updates to the aur for every single commit on the upstream VCS.  Users of the package will still get the most up to date code any time they build it (and makepkg will locally update the pkgver at that time).

EDIT: if you are "berk" on the AUR too, then it looks like you have two packages, bot -git packages, but only one properly follows the VCS package guidelines (yet the other has been updated very recently and hasn't been fixed).


Yeah I am berk in aur too. Can you send me VCS package guide? And can you explain me how to aur update works when I don't update package version on repository and push it to aur repo? Or any guide? I made package by seeing other aur repos. Thanks anyway.

Offline

#4 2022-07-28 17:35:23

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,449
Website

Re: Auto Update Yay Package Version

https://wiki.archlinux.org/title/VCS_package_guidelines

With an appropriately written VCS PKGBUILD (i.e., a *-git package) anytime you run makepkg on that PKGBUILD, you will get the most up to date code (and makepkg will update the pkgver following the pkgver function).

How this happens with yay is a separated topic.  To the degree it's similar to yaourt, I think there is a --devel flag or similar in order to update VCS packages, but you'd have to read the yay man page for that ... or better yet don't use such a tool until you understand how to build / update aur packages with official tools (e.g., makepkg).


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#5 2022-07-29 07:31:03

berk
Member
Registered: 2022-07-28
Posts: 4

Re: Auto Update Yay Package Version

Trilby wrote:

https://wiki.archlinux.org/title/VCS_package_guidelines

With an appropriately written VCS PKGBUILD (i.e., a *-git package) anytime you run makepkg on that PKGBUILD, you will get the most up to date code (and makepkg will update the pkgver following the pkgver function).

How this happens with yay is a separated topic.  To the degree it's similar to yaourt, I think there is a --devel flag or similar in order to update VCS packages, but you'd have to read the yay man page for that ... or better yet don't use such a tool until you understand how to build / update aur packages with official tools (e.g., makepkg).

Hey, I updated my repository as showed in the VCS Package Guide. Here it is: https://aur.archlinux.org/packages/kubefwd-git
I have two question now.

1-) OK I will get the most recent master branch code when I makepkg -si on this local PKGBUILD file. If I run makepkg -si again on local PKGBUILD file and if there is a another release or commit for master branch, my version on PKGBUILD file will update to new version automatically and I will get newer version. Is that right?

2-) I pushed this PKGBUILD and .SRCINFO to aur repository. And lets say somebody installed my package with yay while the version is 1.22.3-commit1. And there was an another commit to github master branch and new release. And the guy who installed my package with yay run yay -Syyu. My aur repository package version is old, I haven't pushed new PKGBUILD file with new version. What happens to that guy? Will yay detect new version via running pkgver() function? Or yay see old version that I pushed once and see there no version change with local and aur repository.

Offline

#6 2022-07-29 07:40:13

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

Re: Auto Update Yay Package Version

1. Yes.

2. No idea what Yay will do, but building the package will always pull the latest commit. Trilby explained that in #4. You only update the PKGBUILD if the build process changes upstream.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#7 2022-07-29 08:29:49

berk
Member
Registered: 2022-07-28
Posts: 4

Re: Auto Update Yay Package Version

jasonwryan wrote:

1. Yes.

2. No idea what Yay will do, but building the package will always pull the latest commit. Trilby explained that in #4. You only update the PKGBUILD if the build process changes upstream.


I simulated the 2. question and yay won't auto update when there is new commit to new branch because origin PKGBUILD version is still same as expected.

What I wanna do is when there is a commit or release on github repo, my aur repo version should get updated too without my PKGBUILD change and push. Is there a way for this?

Offline

#8 2022-07-29 08:33:53

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,427

Re: Auto Update Yay Package Version

Yes, as already mentioned, yay's --devel flag.

https://github.com/Jguer/yay#developmen … es-upgrade

How exactly did you "simulate"?

Last edited by V1del (2022-07-29 08:34:30)

Offline

#9 2022-07-29 12:13:52

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,449
Website

Re: Auto Update Yay Package Version

berk wrote:

And the guy who installed my package with yay run yay -Syyu. What happens to that guy?

There's a good chance he'd be mocked for 1) not understanding how the aur works, 2) not understanding how pacman works and / or not having read any documentation or best practices on it, and 3) not even having read yay's documentation or usage notes.  That is (almost) never the proper command to use to update anything - even if one intends to use yay as a pacman wrapper that is completely the wrong command.

If that "other guy" uses a more than half-baked aur helper and uses it according to it's documentation he'll get the update to the newest code as intended.

EDIT: and dispite it not suiting my goals and being "marketted" in ways I find troubling, yay is certainly more than half baked.  It was written and maintained by quite competent developers who have created a very clear README and detailed man page which you apparently have not read.

Last edited by Trilby (2022-07-30 02:44:42)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#10 2022-08-02 14:27:23

Stefan Husmann
Member
From: Germany
Registered: 2007-08-07
Posts: 1,391

Re: Auto Update Yay Package Version

VCS packages are much much better updated using a simple script than by any aur helper. Something like this:

#!/bin/sh
cd <wherever you put your stuff to>
for i in \
	package_1 \
	package_2 \
...	
   package_n
do 
    rm -fr $i # clean up previuos checkouts in case the AUR package changed somhow
    aurdownload $i # put in a tool to download the AUR repo 
    pushd $i
    customizepkg -m # apply locally changes if you like
    makepkg -Cs --noconfirm && repoctl update $i   # second part only if you use a personal repo
    popd
    sudo pacman -Suy --noconfirm
done

Offline

#11 2022-08-02 15:10:53

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,449
Website

Re: Auto Update Yay Package Version

So you "rm -rf" all content of every single AUR package every single time through the loop?  That'd remove all but one of the built packages before you ever run pacman to install them (unless you have makepkg configured to store built packages somewhere else).

In any case, discussing how you update aur packages that you use is not relevant to this thread.  The OP is asking about updating the content on the AUR for packages they maintain.

Last edited by Trilby (2022-08-02 15:12:58)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#12 2022-08-02 20:27:27

Stefan Husmann
Member
From: Germany
Registered: 2007-08-07
Posts: 1,391

Re: Auto Update Yay Package Version

So you "rm -rf" all content of every single AUR package every single time through the loop?

Yes, exactly.

(unless you have makepkg configured to store built packages somewhere else).

I should have mentioned that I did this, yes. And that I use a personal repo.

The OP is asking about updating the content on the AUR for packages they maintain.

I have two such scripts, one for the VCS-packages I use and one for VCS-packages I maintain. 

My main point is that yay (or any other aur helper) is not suited to maintain AUR VCS-packages. AUR helpers are for AUR users, not for AUR maintainers.

Offline

#13 2022-08-02 22:09:27

2ManyDogs
Forum Moderator
Registered: 2012-01-15
Posts: 4,645

Re: Auto Update Yay Package Version

Stefan Husmann wrote:

My main point is that yay (or any other aur helper) is not suited to maintain AUR VCS-packages. AUR helpers are for AUR users, not for AUR maintainers.

And you've made your point now -- let's not get sidetracked into scripts.

berk, has your question been answered? If it has please remember to mark your thread [SOLVED] (edit the title of your first post).


How to post. A sincere effort to use modest and proper language and grammar is a sign of respect toward the community.

Offline

Board footer

Powered by FluxBB