You are not logged in.

#1 2012-10-01 08:13:42

techryda
Member
Registered: 2012-10-01
Posts: 50

Robust, scriptable, repo management

I have an idea of how repo management on Arch could be improved.

Parsing pacman.conf from a script to add/remove or enable/disable repos is no fun

Rather than having a list of repos in pacman.conf, repos could be stored
in individual .repo files in /etc/pacman.d/repos/available/.
Symlinks would be created in /etc/pacman.d/repos/active/ pointing to .repo files in 'available'.

Repos would be ordered similar to udev rules:

10_kde-unstable.repo        
20_gnome-unstable.repo
30_testing.repo        
40_core.repo
50_extra.repo
60_community-testing.repo
70_community.repo
80_multilib-testing.repo
90_multilib.repo

Example .repo files:
50_extra.repo:

SigLevel = PackageRequired
Include = /etc/pacman.d/mirrorlist
Architecture = Both

90_multilib.repo:

SigLevel = PackageRequired
Include = /etc/pacman.d/mirrorlist
# This would allow pacman to silently ignore an enabled repo if the architecture is unsupported
Architecture = x86_64

Benefits:
    Ability to add/remove repos by copying files into 'available' directory
    Ability to enable/disable repos by using symlinks in 'active'
    Possibility of adding dbus api and/or shell script to add/remove/reorder repos
    No more parsing pacman.conf to add/remove repos via script
    Shorter pacman.conf

Drawbacks:
    Don't see any.  Well, ok, it increases pacman's code complexity.

What are people's thoughts on this?

Last edited by techryda (2012-10-01 10:19:10)

Offline

#2 2012-10-01 08:25:38

thoho180192
Member
Registered: 2012-05-08
Posts: 57

Re: Robust, scriptable, repo management

Do people have that many repos to manage that this actually becomes an advantage?

I do see how this could be great to use with scripts to manage the config file. Like systemctl to add/remove deamons, you could have another tool to manage repos. Nice idea anyways.

Last edited by thoho180192 (2012-10-01 08:26:53)

Offline

#3 2012-10-01 08:35:27

techryda
Member
Registered: 2012-10-01
Posts: 50

Re: Robust, scriptable, repo management

It's not that editing pacman.conf by hand is a hassle but I sometimes have cause to add / remove repos
via a script and parsing pacman.conf to do that is a hassle IMHO.  I'm all for human editable text files for
configuring linux apps/services but they should also be scriptable

I'm a big fan of udev, systemd, etc which all seem to have found the right mix of human editable, easily scriptable
configuration interfaces.  I think it would be a nice option for Arch going forward.

Offline

#4 2012-10-01 09:00:58

thoho180192
Member
Registered: 2012-05-08
Posts: 57

Re: Robust, scriptable, repo management

I like the idea, and I dont see that it will be any more complicated for the user to manage pacman. Thats the inportant aspect in my opinion. I dont like it if its going to be impossible for the user to actually understand what is going on.

I wonder what other peoples thought are thoug.

Offline

#5 2012-10-01 09:14:40

techryda
Member
Registered: 2012-10-01
Posts: 50

Re: Robust, scriptable, repo management

I don't think it's hard to understand or interact with at all.  Definately not any harder than it is to work with udev or systemd.
And...this is Arch.  We're a community of reasonably competent users or ambitious new users with a desire to learn
and we have a wiki to assist.

Offline

#6 2012-10-01 10:45:30

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,097
Website

Re: Robust, scriptable, repo management

So if suddenly I want to point at a different config with different repos enabled for the purposes of maintaining chroots, how do you propose I do this?

I think a more natural way to extend this would be to introduce an IncludeDir directive in the current config.

Offline

#7 2012-10-01 10:51:02

techryda
Member
Registered: 2012-10-01
Posts: 50

Re: Robust, scriptable, repo management

Good point! I hadn't considered that and I should have because I use that functionality often.

I like your suggestion, it's the best of both worlds.

Offline

#8 2012-10-01 11:04:54

techryda
Member
Registered: 2012-10-01
Posts: 50

Re: Robust, scriptable, repo management

So, a default install would have the following "template" repos in a repo/template directory?

30_testing.repo        
40_core.repo
50_extra.repo
60_community-testing.repo
70_community.repo 
80_multilib-testing.repo [64-bit only]
90_multilib.repo [64-bit only]

And the following repos (copies of the above) would be in a repo/active directory?

40_core.repo
50_extra.repo
70_community.repo

With a RepoDir= line in pacman.conf

I like it!

Note: I'm not married to the names/locations of the repo dirs, just using them as examples.

Last edited by techryda (2012-10-01 11:26:42)

Offline

#9 2012-10-01 11:32:05

techryda
Member
Registered: 2012-10-01
Posts: 50

Re: Robust, scriptable, repo management

So, @falconindy, how do I file an 'official' feature request for this?
Do I bring it up on the mailing list, file a bug?

Thanks.

Offline

#10 2012-10-01 13:30:21

thoho180192
Member
Registered: 2012-05-08
Posts: 57

Re: Robust, scriptable, repo management

Bugtracker I think

Offline

#11 2012-10-01 14:07:26

techryda
Member
Registered: 2012-10-01
Posts: 50

Re: Robust, scriptable, repo management

Added feature request, please vote if you're interested.

FS#31754

Edit: oops, posted link to the wrong bug (fixed)

Last edited by techryda (2012-10-01 15:18:56)

Offline

#12 2012-11-14 16:41:02

karol
Archivist
Registered: 2009-05-06
Posts: 25,434

Re: Robust, scriptable, repo management

Maybe having multiple pacman.conf files would solve it as well (until IncludeDir that falconindy mentioned gets implemented :-) ).
Consider two config files: the regular pacman.conf and pacmantesting.conf. The difference is the latter has testing repos uncommented. You can use it like this:

pacman --config /etc/pacmantesting.conf -Syu

Offline

Board footer

Powered by FluxBB