~andreserl/maas/qa_fix_machines

242.1.3 by Diogo Matsubara
add script to update the changelog in the unbuilt tree
1
#!/usr/bin/python
2
# This script updates the changelog of an unbuilt maas source package.
3
# Should be called like:
4
# ./update_changelog.py <path-to-changelog> <branch_revno> <packaging_revno>
5
6
7
import sys
261.2.2 by jtv at canonical
Format imports.
8
242.1.3 by Diogo Matsubara
add script to update the changelog in the unbuilt tree
9
from debian.changelog import Changelog
10
11
12
if __name__ == "__main__":
13
    args = sys.argv[1:]
14
    ch = Changelog(open(args[0]))
15
    new_version = '%s+%s+%s-%s'
16
    ch.set_version(new_version % (ch.upstream_version,
17
                                  args[1],
18
                                  args[2],
19
                                  ch.debian_version))
20
    ch.write_to_open_file(open(args[0], 'w'))