summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlav Vitters <olav@vitters.nl>2014-07-06 19:33:16 +0200
committerOlav Vitters <olav@vitters.nl>2014-07-06 19:33:16 +0200
commitc1cbcf06da762372d31bc69ab8b09e9d1c03bc34 (patch)
treefbefa58a9bba66a9d8a50a6a3396b823a13cd5c1
parent93ae8ce2d44536b451c56a1f46a5c8305e94d641 (diff)
downloadmgagnome-c1cbcf06da762372d31bc69ab8b09e9d1c03bc34.tar
mgagnome-c1cbcf06da762372d31bc69ab8b09e9d1c03bc34.tar.gz
mgagnome-c1cbcf06da762372d31bc69ab8b09e9d1c03bc34.tar.bz2
mgagnome-c1cbcf06da762372d31bc69ab8b09e9d1c03bc34.tar.xz
mgagnome-c1cbcf06da762372d31bc69ab8b09e9d1c03bc34.zip
handle more clean section variations and spaces in defattr as well as allow a %doc definition
-rwxr-xr-xmgagnome4
1 files changed, 2 insertions, 2 deletions
diff --git a/mgagnome b/mgagnome
index 3ac4748..f111195 100755
--- a/mgagnome
+++ b/mgagnome
@@ -384,9 +384,9 @@ class SpecFile(object):
re_rm_buildroot = r'^(?:\s*\[[^\n\]\[]+\][ \t]+\&\&[ \t]+)?(?:rm|\%__rm|\%\{__rm\}) *(?:-rf|-fr|-r) *"?(?:[%$]buildroot|[%$]\{buildroot\}|[%$]\{buildroot\}|\$RPM_BUILDROOT|\$RPM_BUILD_ROOT|\$\{RPM_BUILD_ROOT\}|\$RPM_BUILD_DIR)"?/?[ \t]*\n'
re_clean_spec = [
# remove %defattr
- ('remove defattr', re.compile(r'(?P<keeppre>^\%files(?:[ \t]+[^\n]*)?\n)^\%defattr\s*\(-, *root, *root(?:, *-)?\)\s*\n', re.MULTILINE + re.IGNORECASE)),
+ ('remove defattr', re.compile(r'(?P<keeppre>^\%files(?:[ \t]+[^\n]*)?\n(?:^\%doc [^\n]+\n)?)^\%defattr\s*\(- *, *root *, *root *(?:, *-)?\)\s*\n', re.MULTILINE + re.IGNORECASE)),
('remove cleaning buildroot in install', re.compile(r'(?P<keeppre>^\%install(?:[ \t]+[^\n]*)?\n)' + re_rm_buildroot + r'\n?', re.MULTILINE + re.IGNORECASE)),
- ('remove clean section', re.compile(r'^\%clean[ \t]*\n(?:' + re_rm_buildroot + r')?\s*(?P<keeppost>^(?:\%files|\%post|\%pre|\%trigger|\%install|\%check|\%_font_pkg|$(?!.|\n)))', re.MULTILINE + re.IGNORECASE)),
+ ('remove clean section', re.compile(r'^\%clean[ \t]*\n(?:' + re_rm_buildroot + r')?\s*(?P<keeppost>^(?:\%files|\%post|\%pre|\%trigger|\%install|\%package|\%check|\%_font_pkg|$(?!.|\n)))', re.MULTILINE + re.IGNORECASE)),
('remove buildroot definition', re.compile(r'^BuildRoot:[^\n]+\n', re.MULTILINE + re.IGNORECASE)),
]
re_convert_br = [