diff options
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") |