diff options
author | Thomas Lundström <thomas.lundstrom@enea.com> | 2016-06-08 17:18:05 +0200 |
---|---|---|
committer | Thomas Lundström <thomas.lundstrom@enea.com> | 2016-06-08 17:21:30 +0200 |
commit | 6871890f9e5778619c8d76117655dd075c1b7b78 (patch) | |
tree | 33208a1b1e721749420e8dc6edfc017249f2770a /doc/gen_pkgdiff.py | |
parent | 10705007c2e3bb073deaf7525df6a712e7842dd8 (diff) | |
download | el_manifests-standard-6871890f9e5778619c8d76117655dd075c1b7b78.tar.gz |
Updated release info
Diffstat (limited to 'doc/gen_pkgdiff.py')
-rw-r--r-- | doc/gen_pkgdiff.py | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/doc/gen_pkgdiff.py b/doc/gen_pkgdiff.py index acfbadc..7dd8c73 100644 --- a/doc/gen_pkgdiff.py +++ b/doc/gen_pkgdiff.py | |||
@@ -12,7 +12,8 @@ | |||
12 | # | 12 | # |
13 | # Note that packages with the unchanged version is not listed. | 13 | # Note that packages with the unchanged version is not listed. |
14 | # | 14 | # |
15 | # The output is presented as XML code printed to stdout. | 15 | # The output is presented as XML code printed to stdout. A summary is printed |
16 | # to STDERR at the end. | ||
16 | # | 17 | # |
17 | ############################################################################### | 18 | ############################################################################### |
18 | 19 | ||
@@ -22,11 +23,18 @@ import xml.etree.ElementTree as ET | |||
22 | 23 | ||
23 | def get_pkgs(file_spec): | 24 | def get_pkgs(file_spec): |
24 | if file_spec.find(":") >= 0: | 25 | if file_spec.find(":") >= 0: |
25 | cmd = ("git", "show", file_spec) | 26 | s = subprocess.check_output(("git", "show", file_spec)) |
26 | root = ET.fromstring(subprocess.check_output(cmd)) | ||
27 | |||
28 | else: | 27 | else: |
29 | root = ET.parse(file_spec) | 28 | f = open(file_spec) |
29 | s = f.read() | ||
30 | f.close() | ||
31 | del f | ||
32 | |||
33 | # ET can't handle some special quotes | ||
34 | for old, new in (("”", """), ("”", """)): | ||
35 | s = s.replace(old, new) | ||
36 | |||
37 | root = ET.fromstring(s) | ||
30 | 38 | ||
31 | for node in root.iter("section"): | 39 | for node in root.iter("section"): |
32 | if "id" in node.attrib: | 40 | if "id" in node.attrib: |