aboutsummaryrefslogtreecommitdiffstats
path: root/doc/scripts
diff options
context:
space:
mode:
authorlloyd <lloyd@randombit.net>2009-07-21 03:58:34 +0000
committerlloyd <lloyd@randombit.net>2009-07-21 03:58:34 +0000
commitb7903d02cf3069fc01409929b562be5205c3f7ae (patch)
treec85e5c0759cedceece870e17634da3d846ccfb2c /doc/scripts
parent9f9517d0067e67732a4226061b952f092ecd47ac (diff)
Only append <requires> if at least one dep
Diffstat (limited to 'doc/scripts')
-rwxr-xr-xdoc/scripts/update_deps.py16
1 files changed, 10 insertions, 6 deletions
diff --git a/doc/scripts/update_deps.py b/doc/scripts/update_deps.py
index 8bada9d7e..61aa887cc 100755
--- a/doc/scripts/update_deps.py
+++ b/doc/scripts/update_deps.py
@@ -14,12 +14,16 @@ def update_requires(dir, deps):
while lines.pop(start) != '</requires>':
pass
- lines.append('')
- lines.append('<requires>')
- for dep in deps:
- lines.append(dep)
- lines.append('</requires>')
- lines.append('')
+ while lines[-1] == '':
+ lines = lines[:-1]
+
+ if len(deps) > 0:
+ lines.append('')
+ lines.append('<requires>')
+ for dep in deps:
+ lines.append(dep)
+ lines.append('</requires>')
+ lines.append('')
lines = "\n".join(lines).replace("\n\n\n", "\n\n")