You are not logged in.
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
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
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
Nope…
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
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.
Thank you again.
Offline
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
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
Online
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
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