From af2be3b977428958963f35c5507ac71e7018f65f Mon Sep 17 00:00:00 2001 From: Markus Lehtonen Date: Tue, 4 Feb 2014 17:49:28 +0200 Subject: rpm: add gbp.rpm.changelog module This new module contains basic containers and functionality for parsing and updating rpm changelogs. It is coupled with the rpm packaging policy class which now has definitions for rpm changelog formatting. Signed-off-by: Markus Lehtonen --- gbp/rpm/policy.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'gbp/rpm/policy.py') diff --git a/gbp/rpm/policy.py b/gbp/rpm/policy.py index 80e0abd..f52b870 100644 --- a/gbp/rpm/policy.py +++ b/gbp/rpm/policy.py @@ -70,3 +70,19 @@ class RpmPkgPolicy(PkgPolicy): return True return False + class Changelog(object): + """Container for changelog related policy settings""" + + # Regexps for splitting/parsing the changelog section (of + # Tizen / Fedora style changelogs) + section_match_re = r'^\*' + section_split_re = r'^\*\s*(?P\S.*?)$\n(?P.*)' + header_split_re = r'(?P\S.*\s[0-9]{4})\s+(?P\S.*$)' + header_name_split_re = r'(?P[^<]*)\s+<(?P[^>]+)>((\s*-)?\s+(?P\S+))?$' + body_name_re = r'\[(?P.*)\]' + + # Changelog header format (when writing out changelog) + header_format = "* %(time)s %(name)s <%(email)s> %(revision)s" + header_time_format = "%a %b %d %Y" + header_rev_format = "%(version)s" + -- cgit v1.2.3