diff options
author | Joshua Harlow <harlowja@yahoo-inc.com> | 2012-10-05 11:30:36 -0700 |
---|---|---|
committer | Joshua Harlow <harlowja@yahoo-inc.com> | 2012-10-05 11:30:36 -0700 |
commit | 6cfb1d869614e8ceee45c4443ec65603cce72b78 (patch) | |
tree | 2c9d2ce89f7d137a035195bea32d1b1b4c9a17d3 /packages/brpm | |
parent | 130d90cc675db6f33d294bf04e9c74227c07db50 (diff) | |
download | vyos-cloud-init-6cfb1d869614e8ceee45c4443ec65603cce72b78.tar.gz vyos-cloud-init-6cfb1d869614e8ceee45c4443ec65603cce72b78.zip |
Only allow the first missing version to
use the datetime.now(), the others get
a warning message.
Diffstat (limited to 'packages/brpm')
-rwxr-xr-x | packages/brpm | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/packages/brpm b/packages/brpm index 5aecad65..28136d74 100755 --- a/packages/brpm +++ b/packages/brpm @@ -126,13 +126,22 @@ def generate_spec_contents(args, tmpl_fn, top_dir, arc_fn): # Format a nice changelog (as best as we can) changelog = util.load_file(util.abs_join(find_root(), 'ChangeLog')) changelog_lines = [] + missing_versions = 0 for line in changelog.splitlines(): if not line.strip(): continue if re.match(r"^\s*[\d][.][\d][.][\d]:\s*", line): line = line.strip(":") header = get_log_header(line) - if header: + if not header: + missing_versions += 1 + if missing_versions == 1: + # Must be using a new 'dev'/'trunk' release + changelog_lines.append(format_change_line(datetime.now(), '??')) + else: + sys.stderr.write(("Changelog version line %s " + "does not have a corresponding tag!") % (line)) + else: changelog_lines.append(header) else: changelog_lines.append(line) |