summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Pipping <sebastian@pipping.org>2010-01-13 23:26:12 +0100
committerSebastian Pipping <sebastian@pipping.org>2010-01-13 23:26:12 +0100
commit43d715df2d21e4646ddba69211e54ec4e853e1e5 (patch)
tree42c7ea185f2782b9263be1cd8bb92ccf1a65ce7d
parentPlanet config writer: Add overlays.ini.base (diff)
downloadrepositories-xml-format-43d715df2d21e4646ddba69211e54ec4e853e1e5.tar.gz
repositories-xml-format-43d715df2d21e4646ddba69211e54ec4e853e1e5.tar.bz2
repositories-xml-format-43d715df2d21e4646ddba69211e54ec4e853e1e5.zip
Planet config writer: Pull [Planet] section back on top
-rwxr-xr-xwrite-overlays-ini.py23
1 files changed, 15 insertions, 8 deletions
diff --git a/write-overlays-ini.py b/write-overlays-ini.py
index 6a834e6..0e13d53 100755
--- a/write-overlays-ini.py
+++ b/write-overlays-ini.py
@@ -23,7 +23,6 @@ a = ET.parse(open(repositories_xml_location))
repositories = a.getroot()
overlays_ini = ConfigParser()
-overlays_ini.read(overlays_base_location)
feed_uri_to_name = {}
@@ -80,17 +79,25 @@ for repo in repositories:
f = open(overlays_ini_location, 'w')
f.write("""\
-# NOTE: This file was GENERATED on %(date)s, do not edit directly.
-#
-# The code of the generator script (%(script)s) is up here:
-# http://git.overlays.gentoo.org/gitweb/?p=proj/repositories-xml-format.git;a=summary
+# NOTE: This file has been GENERATED, DO NOT EDIT DIRECTLY.
#
+# Date:
+# %(date)s
#
-# Look for [Planet] and [DEFAULT] further down.
-# (The order of sections is nothing we can teach ConfigParser.write() easily ..)
+# Sources:
+# - %(overlays_ini_base)s
+# - %(repositories_xml)s
#
+# The code of the generator script (%(script)s) is up here:
+# http://git.overlays.gentoo.org/gitweb/?p=proj/repositories-xml-format.git;a=summary
+
""" % {
'date':str(datetime.date.today()),
- 'script':os.path.basename(sys.argv[0])})
+ 'script':os.path.basename(sys.argv[0]),
+ 'overlays_ini_base':os.path.basename(overlays_base_location),
+ 'repositories_xml':os.path.basename(repositories_xml_location)})
+g = open(overlays_base_location, 'r')
+f.write(g.read())
+g.close()
overlays_ini.write(f)
f.close()