SOURCES: kernel-config.py - allow "all" and arch configs, use arch...

glen glen at pld-linux.org
Tue Jan 29 00:47:29 CET 2008


Author: glen                         Date: Mon Jan 28 23:47:29 2008 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- allow "all" and arch configs, use arch fallback to "all"

---- Files affected:
SOURCES:
   kernel-config.py (1.6 -> 1.7) 

---- Diffs:

================================================================
Index: SOURCES/kernel-config.py
diff -u SOURCES/kernel-config.py:1.6 SOURCES/kernel-config.py:1.7
--- SOURCES/kernel-config.py:1.6	Mon Jan 28 20:42:40 2008
+++ SOURCES/kernel-config.py	Tue Jan 29 00:47:24 2008
@@ -90,29 +90,29 @@
     c = l.strip().split()
     symbol = c[0]
     if dict.has_key(symbol):
-        print "Duplicate symbol %s!" % symbol
+        print "Duplicate symbol: %s" % symbol
         rc = 1
         continue
 
-    par = False
-    for i in c[1:]:
-        par = True
-        i = i.split('=')
-        key = i[0]
-        if key != arch and key != "all": 
-            continue
-
+    hash = {}
+    for item in c[1:]:
         try:
-            val = i[1]
+            (key, value) = item.split('=')
+            hash[key] = value
         except IndexError:
             print "Invalid line: %s" % l.strip()
+            err = 1
             continue
 
-        dict[symbol] = val
-    if not par:
-        print "Unknown line: %s" % l
+    if len(hash) == 0:
+        print "Bad line: %s" % l
         rc = 1
-        continue
+
+    # take arch line, otherwise fallback to 'all'
+    if hash.has_key(arch):
+        dict[symbol] = hash[arch]
+    if hash.has_key('all'):
+        dict[symbol] = hash['all']
 
 f.close()
 
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SOURCES/kernel-config.py?r1=1.6&r2=1.7&f=u



More information about the pld-cvs-commit mailing list