diff options
-rwxr-xr-x | packages/brpm | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/packages/brpm b/packages/brpm index 1735f5bb..7975e05c 100755 --- a/packages/brpm +++ b/packages/brpm @@ -58,8 +58,7 @@ def get_log_header(version): a_rev = rev break if not a_rev: - return format_change_line(datetime.now(), - '??', version) + return None # Extract who made that tag as the header cmd = ['bzr', 'log', '-r%s' % (a_rev), '--timezone=utc'] @@ -127,13 +126,23 @@ 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) - changelog_lines.append(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!\n") % (line)) + else: + changelog_lines.append(header) else: changelog_lines.append(line) subs['changelog'] = "\n".join(changelog_lines) |