[Fedora-livecd-list] imgcreate/yuminst.py

Jeremy Katz katzj at fedoraproject.org
Mon Feb 11 19:29:43 UTC 2008


 imgcreate/yuminst.py |   10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

New commits:
commit ce58f625e8215cface69ddc7f12cfbded0e3c66f
Author: Jeremy Katz <katzj at redhat.com>
Date:   Mon Feb 11 14:16:37 2008 -0500

    Ensure removing packages (-foo) really removes them
    
    -foo works as long as the package is a regular package, but it intentionally
    doesn't remove them from being pulled in for deps.  We don't, though, want
    them to be pulled in as a result of the conditional requirements.  So
    go through and remove them from the conditionals dict.  Yes, this is
    ugly but conditionals are generally ugly

diff --git a/imgcreate/yuminst.py b/imgcreate/yuminst.py
index d15ed2f..14f4806 100644
--- a/imgcreate/yuminst.py
+++ b/imgcreate/yuminst.py
@@ -100,7 +100,15 @@ class LiveCDYum(yum.YumBase):
                 txmbrs.append(p)
 
         if len(txmbrs) > 0:
-            map(lambda x: self.tsInfo.remove(x.pkgtup), txmbrs)
+            for x in txmbrs:
+                self.tsInfo.remove(x.pkgtup)
+                # we also need to remove from the conditionals
+                # dict so that things don't get pulled back in as a result
+                # of them.  yes, this is ugly.  conditionals should die.
+                for req, pkgs in self.tsInfo.conditionals:
+                    if x in pkgs:
+                        pkgs.remove(x)
+                        self.tsInfo.conditionals[req] = pkgs
         else:
             print >> sys.stderr, "No such package %s to remove" %(pkg,)
 





More information about the Fedora-livecd-list mailing list