[Yum-devel] [PATCH] basearchonly updates

Adel Gadllah adel.gadllah at gmail.com
Sun Nov 18 14:58:24 UTC 2007


2007/11/18, Jeremy Katz <katzj at redhat.com>:
> Really, looking at the plugin code, it should be of type
> TYPE_INTERACTIVE as opposed to TYPE_CORE given that you're depending on
> having things in the command line.
>
> Which would also avoid the system-install-packages crash as pirut only
> loads core plugins
agreed, new patch attached that fixes the pirut crashes by being
TYPE_INTERACTIVE
it still contains the whitelist fixes so it obsoletes the first patch.

-------
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-devel mailing list