X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=tools%2Fmake-man-rules.py;h=6224de3cc01d15a7bce1e2a9fb2b29bf4124355d;hb=fb099c8d2af6620db2709e826a258089d10cdfe8;hp=0d1ca244c467d0b8bba7fdd85d42bc0f9703eee9;hpb=3c3e5f4276a893791110b03984735654372aa33a;p=elogind.git diff --git a/tools/make-man-rules.py b/tools/make-man-rules.py index 0d1ca244c..6224de3cc 100644 --- a/tools/make-man-rules.py +++ b/tools/make-man-rules.py @@ -66,6 +66,8 @@ def xml(file): def add_rules(rules, name): xml = xml_parse(name) # print('parsing {}'.format(name), file=sys.stderr) + if xml.getroot().tag != 'refentry': + return conditional = xml.getroot().get('conditional') or '' rulegroup = rules[conditional] refmeta = xml.find('./refmeta') @@ -86,7 +88,11 @@ def create_rules(xml_files): " {conditional => {alias-name => source-name}} " rules = collections.defaultdict(dict) for name in xml_files: - add_rules(rules, name) + try: + add_rules(rules, name) + except Exception: + print("Failed to process", name, file=sys.stderr) + raise return rules def mjoin(files):