This is the re-work for --disableexcludes, which takes "all", "main" or
a repoid. It's much shorter than I thought it would be, go figure...

 I've attached it and it can be merged from:

git pull http://people.redhat.com/jantill/gits/yum disable-excludes

-- 
James Antill <[EMAIL PROTECTED]>
diff --git a/cli.py b/cli.py
index d6469c2..b3dbbc1 100644
--- a/cli.py
+++ b/cli.py
@@ -1179,7 +1179,12 @@ class YumOptionParser(OptionParser):
 
             if opts.installroot:
                 self.base.conf.installroot = opts.installroot
- 
+
+            if opts.disableexcludes:
+                self.base.conf.disable_excludes = opts.disableexcludes
+            else:
+                self.base.conf.disable_excludes = []
+                
             for exclude in opts.exclude:
                 try:
                     excludelist = self.base.conf.exclude
@@ -1282,6 +1287,9 @@ class YumOptionParser(OptionParser):
                 metavar='[repo]')
         self.add_option("-x", "--exclude", default=[], action="append",
                 help="exclude package(s) by name or glob", metavar='[package]')
+        self.add_option("", "--disableexcludes", default=[], action="append",
+                help="disable exclude from main, for a repo or for everything",
+                        metavar='[repo]')
         self.add_option("--obsoletes", action="store_true", 
                 help="enable obsoletes processing during updates")
         self.add_option("--noplugins", action="store_true", 
diff --git a/yum/__init__.py b/yum/__init__.py
index de5ce17..734bc9f 100644
--- a/yum/__init__.py
+++ b/yum/__init__.py
@@ -648,14 +648,21 @@ class YumBase(depsolve.Depsolve):
         """removes packages from packageSacks based on global exclude lists,
            command line excludes and per-repository excludes, takes optional 
            repo object to use."""
+
+        if "all" in self.conf.disable_excludes:
+            return
         
         # if not repo: then assume global excludes, only
         # if repo: then do only that repos' packages and excludes
         
         if not repo: # global only
+            if "main" in self.conf.disable_excludes:
+                return
             excludelist = self.conf.exclude
             repoid = None
         else:
+            if repo.id in self.conf.disable_excludes:
+                return
             excludelist = repo.getExcludePkgList()
             repoid = repo.id
 

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
Yum-devel mailing list
[email protected]
https://lists.dulug.duke.edu/mailman/listinfo/yum-devel

Reply via email to