From 93ae8ce2d44536b451c56a1f46a5c8305e94d641 Mon Sep 17 00:00:00 2001 From: Olav Vitters Date: Sun, 6 Jul 2014 19:07:58 +0200 Subject: handle even more remove buildroot variants --- mgagnome | 7 +++---- 1 file 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^\%files(?:[ \t]+[^\n]*)?\n)^\%defattr\s*\(-, *root, *root(?:, *-)?\)\s*\n', re.MULTILINE + re.IGNORECASE)), ('remove cleaning buildroot in install', re.compile(r'(?P^\%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^(?:\%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^(?:\%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)) -- cgit v1.2.1