SOURCES: kernel-config-update.py - use sort from .conf
glen
glen at pld-linux.org
Tue Jan 29 00:24:07 CET 2008
Author: glen Date: Mon Jan 28 23:24:07 2008 GMT
Module: SOURCES Tag: HEAD
---- Log message:
- use sort from .conf
---- Files affected:
SOURCES:
kernel-config-update.py (1.3 -> 1.4)
---- Diffs:
================================================================
Index: SOURCES/kernel-config-update.py
diff -u SOURCES/kernel-config-update.py:1.3 SOURCES/kernel-config-update.py:1.4
--- SOURCES/kernel-config-update.py:1.3 Mon Jan 28 23:44:27 2008
+++ SOURCES/kernel-config-update.py Tue Jan 29 00:24:02 2008
@@ -73,6 +73,7 @@
rc = 0
f = open(kernelconfig, 'r')
+i = 0;
for l in f:
if l[:6] == 'CONFIG_':
print "Omit CONFIG_ when specifing symbol name: %s" % l
@@ -80,6 +81,8 @@
continue
if re.match('^#', l) or re.match('^\s*$', l):
+ dict[i] = l.strip()
+ i = i + 1
continue
if not re.match('^[0-9A-Z]+', l):
@@ -107,6 +110,13 @@
if not rc == 0:
sys.exit(1)
+dict[i] = "#"
+i += 1
+dict[i] = "# New symbols"
+i += 1
+dict[i] = "#"
+i += 1
+
f = open(inconfig, 'r')
for l in f:
# yes, module and string, numeric values
@@ -123,7 +133,7 @@
# other data. perhaps comments
if m == None:
- print l.strip()
+# print l.strip()
continue
if dict.has_key(symbol):
@@ -136,31 +146,29 @@
c['all'] = value # actualy same value
else:
c[arch] = value # actually same value
-
- s = ''
- for k in c.keys():
- s += ' %s=%s' % (k, c[k])
-
- l = "%s %s" % (symbol, s.strip())
- del dict[symbol]
+ dict[symbol] = c
else:
# new symbol gets by default assigned to all
- l = "%s all=%s" % (symbol, value)
+ c = {}
+ c['all'] = value
+ dict[symbol] = c
+# dict[symbol] = ('all', value)
- # blacklist
- # TODO: use some list here instead
- if symbol != "LOCALVERSION" and symbol != "DEFCONFIG_LIST":
- print l
f.close()
-# print out remaining items from old dictionary
-print "#"
-print "# Nonexistent symbols"
-print "#"
for symbol in dict.keys():
- s = ''
c = dict[symbol]
+# print "s=%s, c=%s" % (type(symbol), type(c))
+ if type(symbol) == int:
+ print c
+ continue
+
+ s = ''
for k in c.keys():
s += ' %s=%s' % (k, c[k])
- print "%s %s" % (symbol, s.strip())
+
+ # blacklist
+ # TODO: use some list here instead
+ if symbol != "LOCALVERSION" and symbol != "DEFCONFIG_LIST":
+ print "%s %s" % (symbol, s.strip())
================================================================
---- CVS-web:
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SOURCES/kernel-config-update.py?r1=1.3&r2=1.4&f=u
More information about the pld-cvs-commit
mailing list