blob: 31f69644b6a5efd4708db3e7dd1db245734e29d8 [file] [log] [blame]
Yun Pengf7f37be2018-01-29 05:26:31 -08001# 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
17from datetime import datetime
18import sys
19
20
21def main(input_file, output_file):
laszlocsomorf11c6bc2018-07-05 01:58:06 -070022 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 Pengf7f37be2018-01-29 05:26:31 -080029
laszlocsomorf11c6bc2018-07-05 01:58:06 -070030 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 Pengf7f37be2018-01-29 05:26:31 -080039
40
41if __name__ == "__main__":
42 main(sys.argv[1], sys.argv[2])