[Yum-devel] [PATCH] basearchonly updates

Adel Gadllah adel.gadllah at gmail.com
Sun Nov 18 13:04:48 UTC 2007


Hello,
I updated the basearchonly plugin, the attached patch adds this changes:
* Fix system-install-packages crash on F8
* Add wildcard support to whitelist
* Add all wine packages to the default whitelist on x86 (wine*)

Patch is against current yum-utils git

------
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..ec5e758 100644
--- a/plugins/basearchonly/basearchonly.py
+++ b/plugins/basearchonly/basearchonly.py
@@ -17,6 +17,7 @@
 # Copyright 2007 by Adel Gadllah

 import re, os
+from fnmatch import fnmatch
 from yum.plugins import TYPE_CORE

 requires_api_version = '2.3'
@@ -42,8 +43,9 @@ def basearch(conduit, barch, excludearchP):
 	
 	exclude = []
 	whitelist = []
+	packageList = []
+	skippkg = 0
 	conf , cmd = conduit.getCmdLine()
-	packageList = conduit.getPackages()
 	excludearch = re.compile(excludearchP);
 	
 	if not cmd:
@@ -52,6 +54,10 @@ def basearch(conduit, barch, excludearchP):
 	if cmd[0] != "install":
 		return

+	""" get packagelist """
+
+	packageList = conduit.getPackages()
+
 	""" get whitelist from config file """	
 	
 	conflist = conduit.confString(barch, 'whitelist')
@@ -63,8 +69,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