diff options
author | lloyd <[email protected]> | 2009-07-21 03:58:34 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2009-07-21 03:58:34 +0000 |
commit | b7903d02cf3069fc01409929b562be5205c3f7ae (patch) | |
tree | c85e5c0759cedceece870e17634da3d846ccfb2c /doc/scripts/update_deps.py | |
parent | 9f9517d0067e67732a4226061b952f092ecd47ac (diff) |
Only append <requires> if at least one dep
Diffstat (limited to 'doc/scripts/update_deps.py')
-rwxr-xr-x | doc/scripts/update_deps.py | 16 |
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") |