You are not logged in.

#1 2020-11-26 16:32:56

sshaikh
Member
Registered: 2019-07-03
Posts: 53

[SOLVED] Patching official packages

I'm trying to figure out a sensible workflow for patching packages found in the official repo. The goal is to lean on the official PKGBUILDs as much as possible, and be able to find out reasonably (if not automatically) when to update any forked PKGBUILDs I've spun out.

For items currently in the AUR, I plan on doing the following:

1. Mirror the specific repo pointing to the PKGBUILD in question (I use Gitea, which will synchronise repos every day or so).
2. Fork the mirror and make my changes there.
3. When notified of an update to the mirror (or manually checking), rebase my fork.
4. Reinstall the package if necessary using makepkg etc.

I planned to do similar for the packages in the offical repo, but it seems that there aren't specific repos to mirror for step 1. For example, for termite (which is currently the only official package I want to patch), the git source is held at: https://github.com/archlinux/svntogit-c … mite/trunk. This seems to be a branch, with an equivalent location here: https://github.com/archlinux/svntogit-c … mite/trunk, so I'm confused at the how to get at it. Is the idea to mirror the whole svntogit repo?

What is the best approach to do achieve this goal? I'm happy to consider different solutions if what I'm currently doing for the AUR isn't the best way.

Bonus question: should I be renaming packages too? I read here https://bbs.archlinux.org/viewtopic.php?id=95296 how you should append your name (or similar) and update the conflicts and provides, which makes sense for official packages but I was wondering if that would also apply to AUR (as I plan to manually update those using PKGBUILDs anyway).

Last edited by sshaikh (2020-11-26 19:11:50)

Offline

#2 2020-11-26 16:34:46

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

Re: [SOLVED] Patching official packages

You will want to read https://wiki.archlinux.org/index.php/Arch_Build_System and https://wiki.archlinux.org/index.php/Patching_packages for how to properly handle official packages.

Last edited by V1del (2020-11-26 16:35:34)

Online

#3 2020-11-26 17:34:48

sshaikh
Member
Registered: 2019-07-03
Posts: 53

Re: [SOLVED] Patching official packages

I hadn't read the Patching_packages page, but that seems in line with how I've been successfully adjusting AUR and official PKGBUILDs so far. I will however start generating checksums now, so thanks.

I had already read the ABS wiki page, and a second read did help me answer the question about retrieving official PKGBUILDs.

But my question is more about workflow, and how to track when official PKGBUILDs that I am patching have been updated. I've created what I feel is a suitable one for the AUR, but I can't quite figure out how to do it for the official repo.

I'm now considering writing a script that will download the latest PKGBUILD using asp and if containing changes uploading it to a local repo to then fork off, but it seems a wasteful to have to do that round trip while in the AUR case you can do a more transparent and direct "git mirror".

So far there's only the one official package that I care about, so I may be overstating the issue, but rather than checking and merging updates manually I was looking to see if there's an a more established and elegant solution available.

Regarding naming, I'll go ahead and rename anything I patched so that it's clear it's a "bespoke" package by name.

Offline

#4 2020-11-26 18:13:23

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

Re: [SOLVED] Patching official packages

https://wiki.archlinux.org/index.php/Ar … _using_Git does not answer your question? You'll have a git repo you can pull the relevant changes from there. Not sure on the git mirror thing as the repos ultimately still run on SVN so that might be why it feels "cumbersome" currently.

Last edited by V1del (2020-11-26 18:15:21)

Online

#5 2020-11-26 19:11:29

sshaikh
Member
Registered: 2019-07-03
Posts: 53

Re: [SOLVED] Patching official packages

It helps, and is enough to knock up a solution. I'll marked this as solved and add what I come up with.

Offline

#6 2020-11-27 20:14:40

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: [SOLVED] Patching official packages

You can use the nvchecker program to find updates in upstream software. One of the scrapers it has is "archpkg", which tracks the version of a package that archlinux packaged.


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#7 2020-11-28 19:40:54

sshaikh
Member
Registered: 2019-07-03
Posts: 53

Re: [SOLVED] Patching official packages

I've come up with this. First to start:

#clone the first package via its branch to save downloading the whole repo
git clone -b packages/termite --single-branch [url]https://github.com/archlinux/svntogit-community.git[/url]
cd svntogit-community
#should already be here but just in case
git checkout packages/termite
#use a magic command to create a new branch with just the contents of trunk
git subtree split -P trunk/ -b trunks/termite
#push it somewhere, rename the branch if required
git push http://git-server/arch-packages/termite.git trunks/termite:master

Later to update:

git checkout packages/termite
#should fast forward
git pull 
#the same magic command will update the existing branch
git subtree split -P trunk/ -b trunks/termite
#push it to the same place.
git push http://git-server/arch-packages/termite.git trunks/termite:master

To add further packages:

#register the new package and get it
git remote set-branches --add origin packages/fish
git fetch
#check it out
git checkout packages/fish
#then the same magic command
git subtree split -P trunk/ -b trunks/fish
#and the same push
git push http://git-server/arch-packages/fish.git trunks/fish:master

The same could probably be done with the SVN repo.

This doesn't use asp (as you need access to the remote branches). I'll pass the above to the asp dev to see if it's of any interest to them.

Offline

Board footer

Powered by FluxBB