From 43d715df2d21e4646ddba69211e54ec4e853e1e5 Mon Sep 17 00:00:00 2001 From: Sebastian Pipping Date: Wed, 13 Jan 2010 23:26:12 +0100 Subject: Planet config writer: Pull [Planet] section back on top --- write-overlays-ini.py | 23 +++++++++++++++-------- 1 file 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() -- cgit v1.2.3-65-gdbad