I've written a light pacman wrapper that allows the user to manage packages from a perspective of "what should be on the system" rather than haphazardly installing/removing packages as needs change.
It works by allowing the user to define "sets" of packages, which are conceptually similar to groups, except that they are user defined rather than being something in the package repository, and that they are more powerful; in addition to regular packages, they can also contain groups, other sets, or portions thereof. One set is special: the world set is the set of packages that should be explicitly installed. When pacsync is run, it updates everything according to the current package database, then adjusts the set of packages actually on the system to match the world set plus any dependencies, removing any packages that don't need to be on the system for those packages.
The configuration takes place in files in /etc/pacsync (though an environment variable - PACSYNC_CONF can change this directory). each set has two configuration files, setname.set and setname.mask. each of these has a series of rules in it, one on each line. a rule starting with '<' includes another set. a rule starting with '@' includes a group. any other rule includes an individual package. The set as a whole is the set of all packages that are included (directly or indirectly) in setname.set, but not in setname.mask
All of this, plus some examples, are included in the man page.
pacsync obviates the need for metapackages, since you can simply specify that a group should be installed, and if the packages in the group changes, pacsync will adjust. The original motivation however, was organization; I find after I've had a system installed for a while, there are a decent number of packages I no longer need floating around on the system. pacsync allows one to specify an 'experimental' set for all those packages you just want to try out, or sets of packages needed for specific reasons, which may or may not be relevant in the future. The hope is that this will help keep the cruft off of the system.
Last edited by Zerathidune (2010-11-26 02:53:10)
Not sure if I'd use it myself, but sounds interesting. I think you meant 'holistic', btw.
Good catch on the spelling, fixed it here. will probably wait until I have actual code changes to adjust the AUR package.
This seems like a great idea, and sounds just like something I was wishing for but didn't have the courage to try to implement myself. Is it working well? I think I'm going to try it out. Thanks.
Glad you like the idea. It seems to be doing it's job; I haven't encountered any unexpected hiccups since I released it. I'm sure there are improvements to be made though.
The implementation was actually relatively simple. it's written in bash, have a look if you like. Let me know what you think.
Something I've discovered since using it: I suggested previously that one could create an experimental group for stuff you're just trying out to keep track of things. An alternative, which I've been using, is to just bypass pacsync and use pacman -S to install something just to give it a whirl. This way, if you haven't committed to keeping it by the next time you run pacsync, it will be removed automatically.
thoroughly thoroughly worthy.
aughta be core.
fave quote of the mo': "Man's reach should exceed his grasp, else what's a heaven for." - Robert Browning
I'm toying with the idea of trying this out... I had a look at the code to understand it properly, and found it to be very elegantly coded IMHO (just as a side note!)
Wow.. this application is amazing, really! Very simple to set up and it works great! Thank you for this, Zerathidune!
If you can't sit by a cozy fire with your code in hand enjoying its simplicity and clarity, it needs more work. --Carlos Torres