summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlav Vitters <olav@vitters.nl>2014-07-06 16:12:39 +0200
committerOlav Vitters <olav@vitters.nl>2014-07-06 16:12:39 +0200
commitc391a0f6b9adfb5a05a002836f6f00cf2570415e (patch)
tree7173f44215c1d558dcdb9a7cd8ab86e32628b3f1
parent7a6eb0514640f4174fc4cbeca00f950d98e9df78 (diff)
downloadmgagnome-c391a0f6b9adfb5a05a002836f6f00cf2570415e.tar
mgagnome-c391a0f6b9adfb5a05a002836f6f00cf2570415e.tar.gz
mgagnome-c391a0f6b9adfb5a05a002836f6f00cf2570415e.tar.bz2
mgagnome-c391a0f6b9adfb5a05a002836f6f00cf2570415e.tar.xz
mgagnome-c391a0f6b9adfb5a05a002836f6f00cf2570415e.zip
handle more buildroot removal commands
-rwxr-xr-xmgagnome4
1 files changed, 2 insertions, 2 deletions
diff --git a/mgagnome b/mgagnome
index 7508427..381ea15 100755
--- a/mgagnome
+++ b/mgagnome
@@ -381,12 +381,12 @@ class SpecFile(object):
return self._sources_and_patches(flag=1)
def clean_spec(self):
- re_rm_buildroot = r'^(?:rm|\%\{__rm\}) *(?:-rf|-rf|-r) *(?:\%buildroot|\%\{buildroot\}|\$RPM_BUILDROOT|\$RPM_BUILD_ROOT|\$\{RPM_BUILD_ROOT\}) *\n'
+ re_rm_buildroot = r'^(?:\[[^\n\]\[]+\][ \t]+\&\&[ \t]+)?(?:rm|\%__rm|\%\{__rm\}) *(?:-rf|-fr|-r) *(?:\%buildroot|"\%\{buildroot\}"|\%\{buildroot\}|\$RPM_BUILDROOT|\$RPM_BUILD_ROOT|\$\{RPM_BUILD_ROOT\}|\$RPM_BUILD_DIR)/? *\n'
re_clean_spec = [
# remove %defattr
('remove defattr', re.compile(r'(?P<keeppre>^\%files[^\n]*\n)^\%defattr\s*\(-, *root, *root(?:, *-)?\)\s*\n', re.MULTILINE + re.IGNORECASE)),
('remove cleaning buildroot in install', re.compile(r'(?P<keeppre>^\%install[^\n]*\n)' + re_rm_buildroot + r'\n?', re.MULTILINE + re.IGNORECASE)),
- ('remove clean section', re.compile(r'^\%clean[^\n]*\n' + re_rm_buildroot + r'\n*(?P<keeppost>^(?:\%files|\%post|\%preun))', re.MULTILINE + re.IGNORECASE)),
+ ('remove clean section', re.compile(r'^\%clean[^\n]*\n(?:' + re_rm_buildroot + r')?\n*(?P<keeppost>^(?:\%files|\%post|\%pre|\%trigger|\%check|\%_font_pkg|$(?!.|\n)))', re.MULTILINE + re.IGNORECASE)),
('remove buildroot definition', re.compile(r'^BuildRoot:[^\n]+\n', re.MULTILINE + re.IGNORECASE)),
]