aboutsummaryrefslogtreecommitdiff
path: root/gbp/rpm/policy.py
diff options
context:
space:
mode:
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>2014-02-04 17:49:28 +0200
committerGuido Günther <agx@sigxcpu.org>2016-06-30 11:33:59 +0200
commitaf2be3b977428958963f35c5507ac71e7018f65f (patch)
tree478d39f19a53e9297b16129d3ab53780246e5d98 /gbp/rpm/policy.py
parent7a6641a7b417abeca9cad41538103cbd0f251db8 (diff)
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 <markus.lehtonen@linux.intel.com>
Diffstat (limited to 'gbp/rpm/policy.py')
-rw-r--r--gbp/rpm/policy.py16
1 files changed, 16 insertions, 0 deletions
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<ch_header>\S.*?)$\n(?P<ch_body>.*)'
+ header_split_re = r'(?P<ch_time>\S.*\s[0-9]{4})\s+(?P<ch_name>\S.*$)'
+ header_name_split_re = r'(?P<name>[^<]*)\s+<(?P<email>[^>]+)>((\s*-)?\s+(?P<revision>\S+))?$'
+ body_name_re = r'\[(?P<name>.*)\]'
+
+ # 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"
+