Yun Peng | f7f37be | 2018-01-29 05:26:31 -0800 | [diff] [blame] | 1 | # pylint: disable=g-bad-file-header |
| 2 | # Copyright 2015 The Bazel Authors. All rights reserved. |
| 3 | # |
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | # you may not use this file except in compliance with the License. |
| 6 | # You may obtain a copy of the License at |
| 7 | # |
| 8 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | # |
| 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | # See the License for the specific language governing permissions and |
| 14 | # limitations under the License. |
| 15 | """This tool generates a debian changelog file.""" |
| 16 | |
| 17 | from datetime import datetime |
| 18 | import sys |
| 19 | |
| 20 | |
| 21 | def main(input_file, output_file): |
laszlocsomor | f11c6bc | 2018-07-05 01:58:06 -0700 | [diff] [blame] | 22 | with open(output_file, "w") as changelog_out: |
| 23 | version = None |
| 24 | with open(input_file, "r") as status_file: |
| 25 | for line in status_file: |
| 26 | line = line.strip() |
| 27 | if line.startswith("RELEASE_NAME "): |
| 28 | version = line[len("RELEASE_NAME "):].strip() |
Yun Peng | f7f37be | 2018-01-29 05:26:31 -0800 | [diff] [blame] | 29 | |
laszlocsomor | f11c6bc | 2018-07-05 01:58:06 -0700 | [diff] [blame] | 30 | if version: |
| 31 | changelog_out.write("bazel (%s) unstable; urgency=low\n" % version) |
| 32 | changelog_out.write("\n Bumped Bazel version to %s.\n" % version) |
| 33 | else: |
| 34 | changelog_out.write("bazel (0.1.0~HEAD) unstable; urgency=low\n") |
| 35 | changelog_out.write("\n Development version\n") |
| 36 | changelog_out.write( |
| 37 | "\n -- The Bazel Authors <bazel-dev@googlegroups.com> %s\n\n" % |
| 38 | datetime.now().strftime("%a, %d %b %Y %H:%M:%S +0100")) |
Yun Peng | f7f37be | 2018-01-29 05:26:31 -0800 | [diff] [blame] | 39 | |
| 40 | |
| 41 | if __name__ == "__main__": |
| 42 | main(sys.argv[1], sys.argv[2]) |