[pacman-dev] messy %REASON% handling

Xavier shiningxc at gmail.com
Fri Sep 7 12:41:58 EDT 2007


On Fri, Sep 07, 2007 at 06:27:34PM +0200, Nagy Gabor wrote:
> I'm suggest to work out a %REASON% policy, because I don't like the current method:
> -A/U copies the old reason field, if the old package is installed... OK, but the
> package may become orphan, so we can say, the reason is the _original_ reason;
> if the package is not installed, we get "explicitly installed" reason; fine.
> -however, -S seems buggy: it owerwrites the old reason iff the new reason is
> depend; so [1] if you have a pkg with depend reason, -S pkg will NOT overwrite
> the reason to explicit (here -S is an ~upgrade). [2] And if you have an
> explicitly installed pkg2, and "-S pkg1" also upgrades pkg2 (since pkg1 needs a
> newer version), the reason of pkg2 will be overwritten to depend (I don't like
> this.). Replace makes things even worse...
> So we should define and document the rules, then implement it;-)
> 
> My suggestion:
> -A/U OK, user can use --asdeps, if he want to change the reason (--asexplicit is
> also needed IMHO)
> -S: the reason field should be kept iff the oldpkg is exists
> -change reason of localpkg switch can also be useful: this would let user change
> the depend reason to explicit (see [1])
> 

I just noticed [1] yesterday, as someone on IRC wanted to mark a few packages
as explictly installed (the dependencies of the xorg meta package, which was
removed).
So indeed, the only way to mark these as explicitly installed using pacman
was to remove them, then install them again..
It might be a good idea to have an --asexplicit flag for this case.

> 
> A bit off:
> So I prefer "original reason" way, which can be changed by the user later.
> Only explicit packages are important to the user, all others are needed to
> satisfy deps of explicit packages. So I prefer using the important word instead
> of reason (HoldPkgs are the most important packages.)
> So I'd prefer
> important = 0 <=> depend && !HoldPkg
> important = 1 <=> explicit && !HoldPkg
> important = 2 <=> HoldPkg; so I think HoldPkg should be stored in local db; and
> in sync db
> 

Now I am afraid I lost you, I am not sure how this would be useful.




More information about the pacman-dev mailing list