[yum-cvs] plugins/basearchonly

Tim Lauridsen timlau at linux.duke.edu
Mon Nov 19 09:05:10 UTC 2007


 plugins/basearchonly/basearchonly.conf |    2 +-
 plugins/basearchonly/basearchonly.py   |   14 ++++++++++----
 2 files changed, 11 insertions(+), 5 deletions(-)

New commits:
commit afafd822dbcc0cb296c23ac0cc60e00afc77f7ca
Author: Tim Lauridsen <tla at rasmil.dk>
Date:   Mon Nov 19 10:02:53 2007 +0100

    basearchobly patch by Adel Gadllah
    * Fix system-install-packages crash on F8
    * Add wildcard support to whitelist
    * Add all wine packages to the default whitelist on x86 (wine*)

diff --git a/plugins/basearchonly/basearchonly.conf b/plugins/basearchonly/basearchonly.conf
index f19bf01..b7c5fac 100644
--- a/plugins/basearchonly/basearchonly.conf
+++ b/plugins/basearchonly/basearchonly.conf
@@ -1,7 +1,7 @@
 [main]
 enabled=1
 [x86]
-whitelist = firefox, libflashsupport
+whitelist = firefox, libflashsupport, wine*
 [ppc]
 whitelist = kernel, gdb, frysk, systemtap, ltrace, strace, valgrind
 [sparc]
diff --git a/plugins/basearchonly/basearchonly.py b/plugins/basearchonly/basearchonly.py
index 100cb57..9a5d63d 100644
--- a/plugins/basearchonly/basearchonly.py
+++ b/plugins/basearchonly/basearchonly.py
@@ -17,10 +17,11 @@
 # Copyright 2007 by Adel Gadllah
 
 import re, os
-from yum.plugins import TYPE_CORE
+from fnmatch import fnmatch
+from yum.plugins import TYPE_INTERACTIVE
 
 requires_api_version = '2.3'
-plugin_type = TYPE_CORE
+plugin_type = TYPE_INTERACTIVE
 
 
 def exclude_hook(conduit):
@@ -42,6 +43,7 @@ def basearch(conduit, barch, excludearchP):
 	
 	exclude = []
 	whitelist = []
+	skippkg = 0
 	conf , cmd = conduit.getCmdLine()
 	packageList = conduit.getPackages()
 	excludearch = re.compile(excludearchP);
@@ -63,8 +65,12 @@ def basearch(conduit, barch, excludearchP):
 	""" decide which packages we want to exclude """	
 
 	for userpkg in cmd:
-           if not userpkg in whitelist and not excludearch.search(userpkg):
-               exclude.append(userpkg)
+          skippkg = 0
+          for wlpkg in whitelist:
+               if fnmatch(userpkg,wlpkg):
+                 skippkg = 1
+          if not skippkg and not excludearch.search(userpkg):
+            exclude.append(userpkg)
 
 	""" exclude the packages """	
 	



More information about the Yum-cvs-commits mailing list