summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlav Vitters <olav@vitters.nl>2014-07-06 19:07:58 +0200
committerOlav Vitters <olav@vitters.nl>2014-07-06 19:07:58 +0200
commit93ae8ce2d44536b451c56a1f46a5c8305e94d641 (patch)
tree66eb1f0d15db68f6a897a6322e5d2d7c642fda0e
parent902966ce25302c39fb7c6a8e2d1376f88fc6ca9d (diff)
downloadmgagnome-93ae8ce2d44536b451c56a1f46a5c8305e94d641.tar
mgagnome-93ae8ce2d44536b451c56a1f46a5c8305e94d641.tar.gz
mgagnome-93ae8ce2d44536b451c56a1f46a5c8305e94d641.tar.bz2
mgagnome-93ae8ce2d44536b451c56a1f46a5c8305e94d641.tar.xz
mgagnome-93ae8ce2d44536b451c56a1f46a5c8305e94d641.zip
handle even more remove buildroot variants
-rwxr-xr-xmgagnome7
1 files changed, 3 insertions, 4 deletions
diff --git a/mgagnome b/mgagnome
index d943ae8..3ac4748 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'^(?:\[[^\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_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 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')?\n*(?P<keeppost>^(?:\%files|\%post|\%pre|\%trigger|\%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|\%check|\%_font_pkg|$(?!.|\n)))', re.MULTILINE + re.IGNORECASE)),
('remove buildroot definition', re.compile(r'^BuildRoot:[^\n]+\n', re.MULTILINE + re.IGNORECASE)),
]
re_convert_br = [
@@ -1307,6 +1307,7 @@ def cmd_clean_spec_multi(args):
if change_to is not None: changes[req] = change_to
if not options.doit:
+ import pprint
if changes: pprint.pprint(changes)
if no_alt: print "WARNING: no alternatives found for: %s" % ", ".join(sorted(no_alt))
if no_change: pprint.pprint(no_change)
@@ -1329,8 +1330,6 @@ def cmd_clean_spec(options, parser):
else:
packages = options.package if len(options.package) else (l[0] for l in join_streams())
- import pprint
-
p = multiprocessing.Pool(5)
p.map(cmd_clean_spec_multi, ((options, package) for package in packages))