You are not logged in.

#1 2016-02-01 22:41:11

yuvadm
Member
From: Tel Aviv-Jaffa, Israel
Registered: 2012-08-08
Posts: 103
Website

Using git subtree to manage AUR package collection

I've been struggling to find a nice way to manage all my AUR packages in a single parent git repo, and I believe I've found the best solution that git can provide: git subtree.

Assuming you have such a directory structure:

archlinux-packages
├── aur
│   ├── foo
│   │   └── PKGBUILD
│   ├── goo
│   │   └── PKGBUILD
│   │ ...

The solution looks like so:

$ cd archlinux-packages
$ git remote add -f $pkgname "ssh://aur@aur.archlinux.org/$pkgname.git"
$ git subtree add --prefix "aur/$pkgname" $pkgname master
$ echo bla bla bla > aur/$pkgname/PKGBUILD
$ git commit -m "Added new $pkgname"
$ git subtree push --prefix "aur/$pkgname" $pkgname master
$ git push origin master

This allows you to manage all the packages in on repo, and mirror it on e.g. Github, while still being able to push each subtree to the separate AUR remote it belongs to.

A complete example, including a small helper bash script, can be found on https://github.com/yuvadm/archlinux-packages

Thoughts on this process?

Last edited by yuvadm (2016-02-01 22:41:39)

Offline

#2 2016-02-02 00:19:49

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

Re: Using git subtree to manage AUR package collection

Sounds remarkably like my setup. smile
https://github.com/eli-schwartz/pkgbuilds


But I have been fiddling around with it for a while, and come up with some nice githooks, in addition to the ./aurpublish script which can push, pull, and split --rejoin. I even threw in a log command.

...

githooks == important
There is no good excuse in my mind for not updating your .SRCINFO every time your PKGBUILD changes. But it is so boring and easy to forget...
I also had it suggested to me that it should also verify the checksums are correct.


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

Offline

#3 2016-02-02 07:40:21

yuvadm
Member
From: Tel Aviv-Jaffa, Israel
Registered: 2012-08-08
Posts: 103
Website

Re: Using git subtree to manage AUR package collection

Great stuff Eli! I'll definitely try to reuse lots of the stuff you have there, looks awesome.

Offline

Board footer

Powered by FluxBB