From 6cfb1d869614e8ceee45c4443ec65603cce72b78 Mon Sep 17 00:00:00 2001 From: Joshua Harlow Date: Fri, 5 Oct 2012 11:30:36 -0700 Subject: Only allow the first missing version to use the datetime.now(), the others get a warning message. --- packages/brpm | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'packages') 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) -- cgit v1.2.3