You are not logged in.

#1 2024-09-08 23:47:45

ache
Member
From: Sorry, I'm french
Registered: 2019-09-03
Posts: 13
Website

[SOLVED] Update of a package

Hello,

I just patched the cgit package to add a feature that I once coded, the patch still work.
Now I wonder what will happen on the next update of cgit. The patch won't apply itself so, there is two options. The cgit package will ever "update to the new version", and then removing my patch or "not update to the new version", and printing a warning (I guess?).

So my question, is How I'm suppose to apply a patch to a Arch Linux package that will still be applied to next newest version?
And obviously I must ask, How will be treated errors like, "my patch CAN'T be applied anymore" to the newest version ?

_________

For a detailed context, I patched cgit like that :

$ pkgctl repo clone --protocol=https cgit
$ cd cgit
$ cp ~/git/cgit/link_to_about_when_possible.patch .

Then, I edited the PKGBUILD file to apply the patch. At the end of the prepare function, I added git apply ../../link_to_about_when_possible.patch.

Finally, I build and installed the package with makepkg -si
Now, my cgit installation is patched and worked exactly like I want it to.

But I wonder, What will happen on the next update of the official cgit package? When I will do pacman -Syu, will the cgit package replaces my version of cgit or the whole system update will fail (or just the update of cgit, but that will be a partial update, so I hope not !) ?
How I'm supposed to make my patch persistent?

Should I have a AUR package just to do that?
I'm not sure that my patch is useful enough to interest even a few others.

Thank you in advance,

Last edited by ache (2024-09-11 04:39:19)

Offline

#2 2024-09-09 06:05:56

seth
Member
Registered: 2012-09-03
Posts: 58,698

Re: [SOLVED] Update of a package

Afaiu you've just build and installed a local package that provides cgit (and its dependencies) which is like using an AUR package (except your package isn't shared on the AUR), ie. you're responsible for maintaining it.
The next update will not do anything to your cgit package, it won't remove, replace or update it and (since cgit is a leaf package) will also not fail (otherwise could if there'd be version bound consumers)

cgit itself might fail and require a rebuild or (local) upgrade if any of its dependencies updated in a way that makes them incompatible w/ your build, but that's it.

Offline

#3 2024-09-09 08:27:55

Awebb
Member
Registered: 2010-05-06
Posts: 6,602

Re: [SOLVED] Update of a package

seth wrote:

The next update will not do anything to your cgit package, it won't remove, replace or update it

Are you sure about that? cgit is in the repos and unless OP didn't change the name or set the version to something unrealistic, pacman should update the package. I didn't see anything about ignoring the package in pacman.conf, either.

Offline

#4 2024-09-09 13:33:05

seth
Member
Registered: 2012-09-03
Posts: 58,698

Re: [SOLVED] Update of a package

Nope… hmm
I had expected pacman to not steamroll repo packages over pre-existing local ones, but the repo origin isn't stored at all (or I can't find it), so this will most likely happen - sorry.

@ache, rename the package in the PKGBUILD - it's gonna prevent it from being replace w/ a repo update for sure.
Otherwise you'll figure w/ the next update.

Offline

#5 2024-09-10 08:03:44

ache
Member
From: Sorry, I'm french
Registered: 2019-09-03
Posts: 13
Website

Re: [SOLVED] Update of a package

Thank you very much. I will do that, rename the package to prevent the update.

So, since I got to maintain that package. Does there is a way to get update about a new version of cgit ? 
From the webpage of the package, I found the tag RSS feed of https://gitlab.archlinux.org/archlinux/ … git/-/tags.

If there is any better way to get notification about a new package been released my ears are open. big_smile

Thank you again.

Offline

#6 2024-09-10 09:34:54

Awebb
Member
Registered: 2010-05-06
Posts: 6,602

Re: [SOLVED] Update of a package

There is https://archlinux.org/feeds/packages/, an RSS feeds with all new packages, you could use that, too, but the tag RSS feed should suffice. I used the general feed in the past for various purposes, for example when I had AUR packages that needed to be rebuilt once a specific repo packages gets an update but I didn't want to be surprised.

There is another method and it might not even work aaaand people will not recommend it, because it's a dirty hack that can blow the thing up any minute, but depending on the complexity of the patch, if the patch only changes some text in a script that's not being compiled, you could write a pacman hook that replaces the code in-place (sed -i, perhaps). For example I used this to inject something into the web interface of a media center program, because it was all just plain text HTML/Javascript. Although I have a feeling that "written in plain C" rules that out for cgit.

Offline

#7 2024-09-10 11:14:34

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 12,926

Re: [SOLVED] Update of a package

https://wiki.archlinux.org/title/Arch_package_guidelines#Working_with_upstream wrote:

It is recommended to track upstream with tools such as nvchecker or urlwatch to be informed about new stable releases.

nvchecker & urlwatch are both present in extra repo .


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#8 2024-09-10 13:38:06

seth
Member
Registered: 2012-09-03
Posts: 58,698

Re: [SOLVED] Update of a package

There is another method and it might not even work aaaand people will not recommend it, because it's a dirty hack that can blow the thing up any minute

I had even thought worse:
One could use an alpm hook that schedules a rebuild and installation of the local package whenever some pacman tracked cgit file gets udpated.
You *have* to schedule this (though chances are that just forking it will od because the rebuild takes longer than the rest of the -Syu) because you cannot recursively invoke pacman.
You also have to make sure that the alpm hook does not fire because of the local package installation (otherwise it'll loop forever)

I'd probably go manual here, install and replace the cgit package and add an alpm hook that only sends a notification that this just got updated and you need to update (and/or temporarily re-install the local package)

Offline

#9 2024-09-11 04:38:36

ache
Member
From: Sorry, I'm french
Registered: 2019-09-03
Posts: 13
Website

Re: [SOLVED] Update of a package

Thank you all.

Ok, I will rely on manual operation with automatic update. Ever with RSS feed or with nvchecker.
Automatically apply the patch seems too fragile to be useful.

Offline

Board footer

Powered by FluxBB