[pacman-dev] IgnorePkg, Holdpkg in libalpm/remove.c

Xavier shiningxc at gmail.com
Mon Nov 26 07:31:44 EST 2007


On Mon, Nov 26, 2007 at 12:00:54PM +0100, Nagy Gabor wrote:
> Hi!
> 
> Here is a pactest file derived from remove042.py [not to commit]:
> ---remove049.py---
> self.description = "Cascade remove a package required by a HoldPkg package"
> 
> lp1 = pmpkg("pkg1")
> lp1.depends = ["imaginary"]
> self.addpkg2db("local", lp1)
> 
> lp2 = pmpkg("pkg2")
> lp2.provides = ["imaginary"]
> self.addpkg2db("local", lp2)
> 
> self.option["holdpkg"] = ["pkg1"]
> 
> self.args = "-Rc %s" % lp2.name
> 
> self.addrule("PACMAN_RETCODE=0")
> self.addrule("!PKG_EXIST=pkg1")
> self.addrule("!PKG_EXIST=pkg2")
> -------------------
> [Note: lp2.requiredby is not needed now.]
> 
> As you see, -Rc simply elects a holdpkg for removal without any warning [but at
> least it prints a package summary before commit].
> The same for -Rs <- this is "harder" to fix [elegantly], because
> alpm_recursedeps is a general-purpose deps.c function.
> 
> You probably noticed IgnorePkg in the subject: -Rs and -Rc show, that this can
> be useful with -R too [we may differentiate between RemoveIgnorePkg,
> UpgradeIgnorePkg, and (transaction) IgnorePkg].
> 

Why? Isn't HoldPkg already equivalent to RemoveIgnorePkg? This sounds like
unnecessary complication to me.
However, the scope of HoldPkg might be extended for covering Rc and Rs too,
as you suggested.




More information about the pacman-dev mailing list