Hello community, here is the log from the commit of package spec-cleaner for openSUSE:Factory checked in at 2016-06-07 23:49:18 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/spec-cleaner (Old) and /work/SRC/openSUSE:Factory/.spec-cleaner.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "spec-cleaner" Changes: -------- --- /work/SRC/openSUSE:Factory/spec-cleaner/spec-cleaner.changes 2016-05-23 16:39:03.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.spec-cleaner.new/spec-cleaner.changes 2016-06-07 23:49:20.000000000 +0200 @@ -1,0 +2,9 @@ +Mon Jun 6 10:57:46 UTC 2016 - tchva...@suse.com + +- Version update to 0.8.9: + * Fix one more virtualenv issue + * Fix one case of broken requires splitting + * Properly initialize unbracketing in regexps + * Fix one more case of double pkg-config dependency + +------------------------------------------------------------------- Old: ---- spec-cleaner-0.8.8.tar.gz New: ---- spec-cleaner-0.8.9.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ spec-cleaner.spec ++++++ --- /var/tmp/diff_new_pack.x3MfmV/_old 2016-06-07 23:49:21.000000000 +0200 +++ /var/tmp/diff_new_pack.x3MfmV/_new 2016-06-07 23:49:21.000000000 +0200 @@ -20,7 +20,7 @@ # This is used for Fedora, we need to sync this %{!?py3_ver: %define py3_ver %{python3_version}} Name: spec-cleaner -Version: 0.8.8 +Version: 0.8.9 Release: 0 Summary: .spec file cleaner License: BSD-3-Clause ++++++ spec-cleaner-0.8.8.tar.gz -> spec-cleaner-0.8.9.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/spec-cleaner-spec-cleaner-0.8.8/data/excludes-bracketing.txt new/spec-cleaner-spec-cleaner-0.8.9/data/excludes-bracketing.txt --- old/spec-cleaner-spec-cleaner-0.8.8/data/excludes-bracketing.txt 2016-05-17 10:19:38.000000000 +0200 +++ new/spec-cleaner-spec-cleaner-0.8.9/data/excludes-bracketing.txt 2016-06-05 15:50:10.000000000 +0200 @@ -1,6 +1,4 @@ -aarch64 add_maven_depmap -arm attr(\s*\([^)]*\))? bcond_with[^\s]* build @@ -52,7 +50,6 @@ install install_info install_info_delete -ix86 jar java javac @@ -98,7 +95,6 @@ service_(add|del)_[^\s]* set_permissions setup -sparc stop_on_removal suse_kernel_module_package suse_update_desktop_file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/spec-cleaner-spec-cleaner-0.8.8/spec_cleaner/__init__.py new/spec-cleaner-spec-cleaner-0.8.9/spec_cleaner/__init__.py --- old/spec-cleaner-spec-cleaner-0.8.8/spec_cleaner/__init__.py 2016-05-17 10:19:38.000000000 +0200 +++ new/spec-cleaner-spec-cleaner-0.8.9/spec_cleaner/__init__.py 2016-06-05 15:50:10.000000000 +0200 @@ -12,7 +12,7 @@ from .rpmcleaner import RpmSpecCleaner -__version__ = '0.8.8' +__version__ = '0.8.9' def process_args(argv): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/spec-cleaner-spec-cleaner-0.8.8/spec_cleaner/fileutils.py new/spec-cleaner-spec-cleaner-0.8.9/spec_cleaner/fileutils.py --- old/spec-cleaner-spec-cleaner-0.8.8/spec_cleaner/fileutils.py 2016-05-17 10:19:38.000000000 +0200 +++ new/spec-cleaner-spec-cleaner-0.8.9/spec_cleaner/fileutils.py 2016-06-05 15:50:10.000000000 +0200 @@ -1,6 +1,7 @@ # vim: set ts=4 sw=4 et: coding=UTF-8 import os +import sys import sysconfig from .rpmexception import RpmException @@ -22,19 +23,22 @@ Used all around so kept glob here for importing. """ - try: - # the .. is appended as we are in spec_cleaner sub_folder - _file = open('{0}/../data/{1}'.format(os.path.dirname(os.path.realpath(__file__)), name), 'r') - except IOError: - # try system dir + possible_paths = [ + '{0}/../data/{1}'.format(os.path.dirname(os.path.realpath(__file__)), name), + '{0}/share/spec-cleaner/{1}'.format(sysconfig.get_path('data'), name), + '{0}/share/spec-cleaner/{1}'.format(sys.prefix, name), + ] + for path in possible_paths: try: - # usually /usr - path = sysconfig.get_path('data') - _file = open('{0}/share/spec-cleaner/{1}'.format(path, name), 'r') - except IOError as error: - raise RpmException(str(error)) + _file = open(path, 'r') + except IOError: + pass + else: + self.f = _file + return + # file not found + raise RpmException("File '{0}' not found in datadirs".format(name)) - self.f = _file def open(self, name, mode): """ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/spec-cleaner-spec-cleaner-0.8.8/spec_cleaner/rpmcleaner.py new/spec-cleaner-spec-cleaner-0.8.9/spec_cleaner/rpmcleaner.py --- old/spec-cleaner-spec-cleaner-0.8.8/spec_cleaner/rpmcleaner.py 2016-05-17 10:19:38.000000000 +0200 +++ new/spec-cleaner-spec-cleaner-0.8.9/spec_cleaner/rpmcleaner.py 2016-06-05 15:50:10.000000000 +0200 @@ -25,7 +25,8 @@ from .rpminstall import RpmInstall from .rpmscriplets import RpmScriptlets from .rpmfiles import RpmFiles -from .rpmregexp import RegexpSingle +from .rpmregexp import Regexp +from .rpmhelpers import load_keywords_whitelist, parse_rpm_showrc, find_macros_with_arg, read_group_changes, read_licenses_changes, read_pkgconfig_changes class RpmSpecCleaner(object): @@ -48,10 +49,16 @@ # inicialize main license and subpkg option self.options['license'] = None self.options['subpkglicense'] = False + # compile keywords for unbracing + self.options['unbrace_keywords'] = self._unbrace_keywords() + # load all the remaining file operations + self.options['pkgconfig_conversions'] = read_pkgconfig_changes() + self.options['license_conversions'] = read_licenses_changes() + self.options['allowed_groups'] = read_group_changes() # run gvim(diff) in foreground mode if self.options['diff_prog'].startswith("gvim") and " -f" not in self.options['diff_prog']: self.options['diff_prog'] += " -f" - self.reg = RegexpSingle(self.options['specfile']) + self.reg = Regexp(self.options['unbrace_keywords']) self.fin = open(self.options['specfile']) # Section starts detection @@ -89,6 +96,12 @@ else: self.fout = sys.stdout + def _unbrace_keywords(self): + keywords = load_keywords_whitelist() + global_macrofuncs = parse_rpm_showrc() + spec_macrofuncs = find_macros_with_arg(self.options['specfile']) + return keywords + global_macrofuncs + spec_macrofuncs + def _load_licenses(self): # detect all present licenses in the spec and detect if we have more # than one. If we do put license to each subpkg @@ -232,13 +245,13 @@ self.current_section.add(line) self._previous_line = line - if line != '' or not line.startswith('#'): + if line != '' and not line.startswith('#'): self._previous_nonempty_line = line # no need to not output newline at the end even for minimal -> no condition self.current_section.output(self.fout) # add changelog at the end of the file - if line is None or (line is not None and line != '%changelog'): + if self._previous_nonempty_line != '%changelog': self.fout.write('%changelog\n') self.fout.flush() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/spec-cleaner-spec-cleaner-0.8.8/spec_cleaner/rpmhelpers.py new/spec-cleaner-spec-cleaner-0.8.9/spec_cleaner/rpmhelpers.py --- old/spec-cleaner-spec-cleaner-0.8.8/spec_cleaner/rpmhelpers.py 2016-05-17 10:19:38.000000000 +0200 +++ new/spec-cleaner-spec-cleaner-0.8.9/spec_cleaner/rpmhelpers.py 2016-06-05 15:50:10.000000000 +0200 @@ -1,10 +1,52 @@ # vim: set ts=4 sw=4 et: coding=UTF-8 +import re +import os + from .fileutils import FileUtils LICENSES_CHANGES = 'licenses_changes.txt' PKGCONFIG_CONVERSIONS = 'pkgconfig_conversions.txt' GROUPS_LIST = 'allowed_groups.txt' +BRACKETING_EXCLUDES = 'excludes-bracketing.txt' + +def parse_rpm_showrc(): + macros = [] + + re_rc_macrofunc = re.compile(r'^-[0-9]+[:=]\s(\w+)\(.*') + output = os.popen('rpm --showrc') + for line in output: + line = line.rstrip('\n') + found_macro = re_rc_macrofunc.sub(r'\1', line) + if found_macro != line: + macros += [found_macro] + output.close() + return macros + +def load_keywords_whitelist(): + keywords = [] + + files = FileUtils() + files.open_datafile(BRACKETING_EXCLUDES) + for line in files.f: + keywords.append(line.rstrip('\n')) + files.close() + + return keywords + +def find_macros_with_arg(spec): + macrofuncs = [] + + re_spec_macrofunc = re.compile(r'^\s*%define\s(\w+)\(.*') + files = FileUtils() + files.open(spec, 'r') + for line in files.f: + line = line.rstrip('\n') + found_macro = re_spec_macrofunc.sub(r'\1', line) + if found_macro != line: + macrofuncs += [found_macro] + files.close() + return macrofuncs def read_pkgconfig_changes(): pkgconfig = {} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/spec-cleaner-spec-cleaner-0.8.8/spec_cleaner/rpmpreamble.py new/spec-cleaner-spec-cleaner-0.8.9/spec_cleaner/rpmpreamble.py --- old/spec-cleaner-spec-cleaner-0.8.8/spec_cleaner/rpmpreamble.py 2016-05-17 10:19:38.000000000 +0200 +++ new/spec-cleaner-spec-cleaner-0.8.9/spec_cleaner/rpmpreamble.py 2016-06-05 15:50:10.000000000 +0200 @@ -4,7 +4,7 @@ from .rpmsection import Section from .rpmexception import RpmException -from .rpmhelpers import sort_uniq, read_group_changes, read_licenses_changes, read_pkgconfig_changes +from .rpmhelpers import sort_uniq class RpmPreamble(Section): @@ -125,11 +125,11 @@ # do we want pkgconfig self.pkgconfig = options['pkgconfig'] # dict of license replacement options - self.license_conversions = read_licenses_changes() + self.license_conversions = options['license_conversions'] # dict of pkgconfig conversions - self.pkgconfig_conversions = read_pkgconfig_changes() + self.pkgconfig_conversions = options['pkgconfig_conversions'] # list of allowed groups - self.allowed_groups = read_group_changes() + self.allowed_groups = options['allowed_groups'] # start the object self._start_paragraph() # initialize list of groups that need to pass over conversion fixer @@ -364,6 +364,21 @@ s = ' '.join(licenses).replace("( ", "(").replace(" )", ")") return s + def _fix_pkgconfig_name(self, value): + # we just rename pkgconfig names to one unified one working everywhere + if ' ' in value: + pkgname = value.split()[0] + version = value.replace(pkgname, '') + else: + pkgname = value + version = '' + if pkgname == 'pkgconfig(pkg-config)' or \ + pkgname == 'pkg-config': + # If we have pkgconfig dep in pkgconfig it is nuts, replace it + return 'pkgconfig{0}'.format(version) + else: + return value + def _pkgname_to_pkgconfig(self, value): # we just want the pkgname if we have version string there # and for the pkgconfig deps we need to put the version into @@ -371,10 +386,8 @@ pkgname = value.split()[0] version = value.replace(pkgname, '') pkgconfig = [] - if pkgname == 'pkgconfig(pkg-config)' or \ - pkgname == 'pkg-config': - # If we have pkgconfig dep in pkgconfig it is nuts, replace it - return ['pkgconfig{0}'.format(version)] + if pkgname == 'pkgconfig': + return [value] if pkgname not in self.pkgconfig_conversions: # first check if the pacakge is in the replacements return [value] @@ -395,29 +408,28 @@ if not self.previous_line.startswith('#') and not self.minimal: self.current_group.append('# FIXME: Use %requires_eq macro instead') return [value] - # we also skip all various rpm-macroed content as it is usually not easy - # to determine how that should be split - if value.startswith('%'): - return [value] - tokens = [item[1] for item in self.reg.re_requires_token.findall(value)] - # Split based on ',' here as it breaks up pattern matching later on - tokens = [item.split(',') for item in tokens] - tokens = [item for sublist in tokens for item in sublist] # first loop over all and do formatting as we can get more deps for # one expanded = [] for token in tokens: - # cleanup whitespace - token = token.replace(' ', '') - # rpm actually allows ',' separated list of deps - token = token.replace(',', '') # there is allowed syntax => and =< ; hidious token = token.replace('=<', '<=') token = token.replace('=>', '>=') + # we also skip all various rpm-macroed content as it + # is usually not easy to determine how that should be + # split + if token.startswith('%'): + expanded.append(token) + continue + # cleanup whitespace + token = token.replace(' ', '') + token = re.sub(r'([<>]=?|=)', r' \1 ', token) if not token: continue + # replace pkgconfig name first + token = self._fix_pkgconfig_name(token) if self.pkgconfig: token = self._pkgname_to_pkgconfig(token) if isinstance(token, str): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/spec-cleaner-spec-cleaner-0.8.8/spec_cleaner/rpmregexp.py new/spec-cleaner-spec-cleaner-0.8.9/spec_cleaner/rpmregexp.py --- old/spec-cleaner-spec-cleaner-0.8.8/spec_cleaner/rpmregexp.py 2016-05-17 10:19:38.000000000 +0200 +++ new/spec-cleaner-spec-cleaner-0.8.9/spec_cleaner/rpmregexp.py 2016-06-05 15:50:10.000000000 +0200 @@ -1,25 +1,10 @@ # vim: set ts=4 sw=4 et: coding=UTF-8 import re -import os from .fileutils import FileUtils - -class Singleton(object): - - def __init__(self, klass): - self.klass = klass - self.instance = None - - def __call__(self, *args, **kwds): - if self.instance is None: - self.instance = self.klass(*args, **kwds) - return self.instance - - -@Singleton -class RegexpSingle(object): +class Regexp(object): """ Singleton containing all regular expressions compiled in one run. @@ -58,7 +43,7 @@ re_buildrequires = re.compile(r'^BuildRequires:\s*(.*)', re.IGNORECASE) re_prereq = re.compile(r'^PreReq:\s*(.*)', re.IGNORECASE) re_requires = re.compile(r'^Requires:\s*(.*)', re.IGNORECASE) - re_requires_phase = re.compile(r'^Requires(\(\S+\)):\s*(.*)', re.IGNORECASE) + re_requires_phase = re.compile(r'^Requires(\([^)]+\)):\s*(.*)', re.IGNORECASE) re_recommends = re.compile(r'^Recommends:\s*(.*)', re.IGNORECASE) re_suggests = re.compile(r'^Suggests:\s*(.*)', re.IGNORECASE) re_enhances = re.compile(r'^Enhances:\s*(.*)', re.IGNORECASE) @@ -75,7 +60,7 @@ re_define = re.compile(r'^\s*%define\s*(.*)', re.IGNORECASE) re_global = re.compile(r'^\s*%global\s*(.*)', re.IGNORECASE) re_bcond_with = re.compile(r'^\s*%bcond_with(out)?\s*(.*)', re.IGNORECASE) - re_requires_token = re.compile(r'(\s*([^<>=\s]+(\s*[<>=]+\s*[^<>=\s]+)?)\s*)') + re_requires_token = re.compile(r'([\s,]*([^<>=\s,%]+(\s*[<>=]+\s*[^<>=\s,]+)?|[^<>=\s,%]*%{.*}\S*))([\s,]+|$)') re_autoreqprov = re.compile(r'^\s*AutoReqProv:.*$', re.IGNORECASE) re_debugpkg = re.compile(r'^%{?(debug_package|___debug_install_post)}?\s*$', re.IGNORECASE) re_preamble_prefix = re.compile(r'^Prefix:\s*(.*)', re.IGNORECASE) @@ -131,8 +116,6 @@ # macro detection re_macro = re.compile(r'(^|([^%]))%([1-9]\d*|[a-zA-Z_]\w*(\s*\([^)]*\))?)(|(\W))') - # macro func detection - re_spec_macrofunc = re.compile(r'^\s*%define\s(\w+)\(.*') # cleaning path regexps re_oldprefix = re.compile(r'%{?_exec_prefix}?([/\s$])') @@ -153,59 +136,5 @@ re_rpmbuildroot = re.compile(r'(\${?RPM_BUILD_ROOT}?|"%{?buildroot}?")([/\s%]|$)') re_rpmbuildroot_quotes = re.compile(r'"\${?RPM_BUILD_ROOT}?"') - def _load_keywords_whitelist(self): - """ - Create regexp for the unbrace keywords based on - rpm showrc and whitelist. - """ - - BRACKETING_EXCLUDES = 'excludes-bracketing.txt' - - # load the keywords - files = FileUtils() - files.open_datafile(BRACKETING_EXCLUDES) - keywords = [] - for line in files.f: - keywords.append(line.rstrip('\n')) - files.close() - - return keywords - - def _parse_rpm_showrc(self): - """ - Load argumented macros from rpm --showrc - """ - - macros = [] - re_rc_macrofunc = re.compile(r'^-[0-9]+[:=]\s(\w+)\(.*') - output = os.popen('rpm --showrc') - for line in output: - line = line.rstrip('\n') - found_macro = re_rc_macrofunc.sub(r'\1', line) - if found_macro != line: - macros += [found_macro] - output.close() - return macros - - def _find_macros_with_arg(self, spec): - """ - Load argumented macros from specfile - """ - - macrofuncs = [] - - files = FileUtils() - files.open(spec, 'r') - for line in files.f: - line = line.rstrip('\n') - found_macro = self.re_spec_macrofunc.sub(r'\1', line) - if found_macro != line: - macrofuncs += [found_macro] - files.close() - return macrofuncs - - def __init__(self, specfile): - keywords = self._load_keywords_whitelist() - global_macrofuncs = self._parse_rpm_showrc() - spec_macrofuncs = self._find_macros_with_arg(specfile) - self.re_unbrace_keywords = re.compile('%{(' + '|'.join(keywords + global_macrofuncs + spec_macrofuncs) + ')}') + def __init__(self, keywords): + self.re_unbrace_keywords = re.compile('%{(' + '|'.join(keywords) + ')}') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/spec-cleaner-spec-cleaner-0.8.8/spec_cleaner/rpmsection.py new/spec-cleaner-spec-cleaner-0.8.9/spec_cleaner/rpmsection.py --- old/spec-cleaner-spec-cleaner-0.8.8/spec_cleaner/rpmsection.py 2016-05-17 10:19:38.000000000 +0200 +++ new/spec-cleaner-spec-cleaner-0.8.9/spec_cleaner/rpmsection.py 2016-06-05 15:50:10.000000000 +0200 @@ -2,7 +2,7 @@ import re -from .rpmregexp import RegexpSingle +from .rpmregexp import Regexp class Section(object): @@ -22,7 +22,7 @@ self.previous_line = None self.spec = options['specfile'] self.minimal = options['minimal'] - self.reg = RegexpSingle(self.spec) + self.reg = Regexp(options['unbrace_keywords']) # Are we inside of conditional or not self.condition = False self._condition_counter = 0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/spec-cleaner-spec-cleaner-0.8.8/tests/acceptance-tests.py new/spec-cleaner-spec-cleaner-0.8.9/tests/acceptance-tests.py --- old/spec-cleaner-spec-cleaner-0.8.8/tests/acceptance-tests.py 2016-05-17 10:19:38.000000000 +0200 +++ new/spec-cleaner-spec-cleaner-0.8.9/tests/acceptance-tests.py 2016-06-05 15:50:10.000000000 +0200 @@ -220,6 +220,27 @@ with open(compare) as ref, open(tmp_file) as test: self.assertStreamEqual(ref, test) + def test_pkgconfig_disabled_output(self): + test = 'pkgconfrequires.spec' + infile = os.path.join(self.input_dir, test) + compare = os.path.join(self.fixtures_dir, test) + tmp_file = os.path.join(self.tmp_dir, test) + + # first try to generate cleaned content from messed up + options = { + 'specfile': infile, + 'output': tmp_file, + 'pkgconfig': False, + 'inline': False, + 'diff': False, + 'diff_prog': 'vimdiff', + 'minimal': False, + 'no_copyright': True, + } + self._run_individual_test(options) + with open(compare) as ref, open(tmp_file) as test: + self.assertStreamEqual(ref, test) + def test_inline_function(self): test = self._obtain_list_of_tests()[0] infile = os.path.join(self.input_dir, test) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/spec-cleaner-spec-cleaner-0.8.8/tests/in/changelog-newline.spec new/spec-cleaner-spec-cleaner-0.8.9/tests/in/changelog-newline.spec --- old/spec-cleaner-spec-cleaner-0.8.8/tests/in/changelog-newline.spec 1970-01-01 01:00:00.000000000 +0100 +++ new/spec-cleaner-spec-cleaner-0.8.9/tests/in/changelog-newline.spec 2016-06-05 15:50:10.000000000 +0200 @@ -0,0 +1,2 @@ +%changelog + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/spec-cleaner-spec-cleaner-0.8.8/tests/in/excludes-bracketing.spec new/spec-cleaner-spec-cleaner-0.8.9/tests/in/excludes-bracketing.spec --- old/spec-cleaner-spec-cleaner-0.8.8/tests/in/excludes-bracketing.spec 2016-05-17 10:19:38.000000000 +0200 +++ new/spec-cleaner-spec-cleaner-0.8.9/tests/in/excludes-bracketing.spec 2016-06-05 15:50:10.000000000 +0200 @@ -1,6 +1,4 @@ -%aarch64 %add_maven_depmap -%arm %attr(\s*\([^)]*\))? %bcond_with[^\s]* %build @@ -52,7 +50,6 @@ %install %install_info %install_info_delete -%ix86 %jar %java %javac @@ -99,7 +96,6 @@ %service_del_postun foo.service %set_permissions %setup -%sparc %stop_on_removal %suse_kernel_module_package %suse_update_desktop_file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/spec-cleaner-spec-cleaner-0.8.8/tests/in/macros.spec new/spec-cleaner-spec-cleaner-0.8.9/tests/in/macros.spec --- old/spec-cleaner-spec-cleaner-0.8.8/tests/in/macros.spec 2016-05-17 10:19:38.000000000 +0200 +++ new/spec-cleaner-spec-cleaner-0.8.9/tests/in/macros.spec 2016-06-05 15:50:10.000000000 +0200 @@ -1,3 +1,5 @@ +%define useful_macro() ( echo 'Useful macro has been used with arg %1' ) + %build %{?suse_update_config:%{suse_update_config -f}} %{suse_update_config -f} @@ -7,3 +9,4 @@ ./configure --with-bells-and-whistles # this is not autotools ./configure --aughr +%useful_macro 15 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/spec-cleaner-spec-cleaner-0.8.8/tests/in/requires.spec new/spec-cleaner-spec-cleaner-0.8.9/tests/in/requires.spec --- old/spec-cleaner-spec-cleaner-0.8.8/tests/in/requires.spec 2016-05-17 10:19:38.000000000 +0200 +++ new/spec-cleaner-spec-cleaner-0.8.9/tests/in/requires.spec 2016-06-05 15:50:10.000000000 +0200 @@ -5,6 +5,7 @@ Requires: iii <= 4.2.1 jjj> %{version} eee=%{version}-%{release} bbb Requires: aaa<3.2.1 zzz pkgconfig(glib-2.0) perl(DBD::SQLite) Requires: rrr >= %{version} kkk +Requires: %{some_packagename} => %{some_version} PreReq: iii <= 4.2.1 jjj> %{version} eee=%{version}-%{release} aaa PreReq: aaa<3.2.1 zzz @@ -14,3 +15,5 @@ BuildRequires: %{rubygem rails >= 3.2} Requires: php5 => %{phpversion} + +Requires: %{libname} >= %{version} libcurl-devel diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/spec-cleaner-spec-cleaner-0.8.8/tests/out/bconds.spec new/spec-cleaner-spec-cleaner-0.8.9/tests/out/bconds.spec --- old/spec-cleaner-spec-cleaner-0.8.8/tests/out/bconds.spec 2016-05-17 10:19:38.000000000 +0200 +++ new/spec-cleaner-spec-cleaner-0.8.9/tests/out/bconds.spec 2016-06-05 15:50:10.000000000 +0200 @@ -1,6 +1,6 @@ %{!?aarch64:%global aarch64 aarch64 arm64 armv8} -%global jit_arches %ix86 x86_64 %aarch64 ppc64 ppc64le -%global test_arches %ix86 x86_64 ppc64 ppc64le +%global jit_arches %{ix86} x86_64 %{aarch64} ppc64 ppc64le +%global test_arches %{ix86} x86_64 ppc64 ppc64le %global icedtea_version 2.5.1 %global icedtea_sound_version 1.0.1 %global mauvedate 2008-10-22 @@ -31,7 +31,7 @@ # real file made by update-ca-certificates %global javacacerts %{_var}/lib/ca-certificates/java-cacerts %global with_default_hotspot_tarball 1 -%ifarch %aarch64 +%ifarch %{aarch64} %global _with_bootstrap 1 %global _with_zero 1 %endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/spec-cleaner-spec-cleaner-0.8.8/tests/out/changelog-newline.spec new/spec-cleaner-spec-cleaner-0.8.9/tests/out/changelog-newline.spec --- old/spec-cleaner-spec-cleaner-0.8.8/tests/out/changelog-newline.spec 1970-01-01 01:00:00.000000000 +0100 +++ new/spec-cleaner-spec-cleaner-0.8.9/tests/out/changelog-newline.spec 2016-06-05 15:50:10.000000000 +0200 @@ -0,0 +1 @@ +%changelog diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/spec-cleaner-spec-cleaner-0.8.8/tests/out/conditionmultiline.spec new/spec-cleaner-spec-cleaner-0.8.9/tests/out/conditionmultiline.spec --- old/spec-cleaner-spec-cleaner-0.8.8/tests/out/conditionmultiline.spec 2016-05-17 10:19:38.000000000 +0200 +++ new/spec-cleaner-spec-cleaner-0.8.9/tests/out/conditionmultiline.spec 2016-06-05 15:50:10.000000000 +0200 @@ -8,7 +8,7 @@ --with-libpng=system \ --with-lcms=system \ --with-stdc++lib=dynamic \ - %ifnarch %arm + %ifnarch %{arm} --with-num-cores="$NUM_PROC" \ %endif make -j1 @@ -47,7 +47,7 @@ %endif --with-xerces2-jar=%{_javadir}/xerces-j2-bootstrap.jar \ --with-openjdk-src-zip=%{SOURCE1} \ -%ifnarch %arm %aarch64 +%ifnarch %{arm} %{aarch64} --with-parallel-jobs=${NUMCPUS} \ %else --with-parallel-jobs=1 \ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/spec-cleaner-spec-cleaner-0.8.8/tests/out/excludes-bracketing.spec new/spec-cleaner-spec-cleaner-0.8.9/tests/out/excludes-bracketing.spec --- old/spec-cleaner-spec-cleaner-0.8.8/tests/out/excludes-bracketing.spec 2016-05-17 10:19:38.000000000 +0200 +++ new/spec-cleaner-spec-cleaner-0.8.9/tests/out/excludes-bracketing.spec 2016-06-05 15:50:10.000000000 +0200 @@ -1,7 +1,5 @@ %bcond_with[^\s]* -%aarch64 %add_maven_depmap -%arm %attr(\s*\([^)]*\))? %build @@ -59,7 +57,6 @@ %install %install_info %install_info_delete -%ix86 %jar %java %javac @@ -109,7 +106,6 @@ %service_del_postun foo.service %set_permissions %setup -%sparc %stop_on_removal %suse_kernel_module_package %suse_update_desktop_file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/spec-cleaner-spec-cleaner-0.8.8/tests/out/macros.spec new/spec-cleaner-spec-cleaner-0.8.9/tests/out/macros.spec --- old/spec-cleaner-spec-cleaner-0.8.8/tests/out/macros.spec 2016-05-17 10:19:38.000000000 +0200 +++ new/spec-cleaner-spec-cleaner-0.8.9/tests/out/macros.spec 2016-06-05 15:50:10.000000000 +0200 @@ -1,3 +1,5 @@ +%define useful_macro() ( echo 'Useful macro has been used with arg %{1}' ) + %build # FIXME: you should use %%cmake macros cmake . \ @@ -6,5 +8,6 @@ ./configure --with-bells-and-whistles # this is not autotools ./configure --aughr +%useful_macro 15 %changelog diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/spec-cleaner-spec-cleaner-0.8.8/tests/out/requires.spec new/spec-cleaner-spec-cleaner-0.8.9/tests/out/requires.spec --- old/spec-cleaner-spec-cleaner-0.8.8/tests/out/requires.spec 2016-05-17 10:19:38.000000000 +0200 +++ new/spec-cleaner-spec-cleaner-0.8.9/tests/out/requires.spec 2016-06-05 15:50:10.000000000 +0200 @@ -8,6 +8,8 @@ BuildRequires: kkk BuildRequires: rrr >= %{version} BuildRequires: zzz +Requires: %{libname} >= %{version} +Requires: %{some_packagename} >= %{some_version} Requires: aaa < 3.2.1 Requires: bbb Requires: eee = %{version}-%{release} @@ -20,6 +22,7 @@ Requires: zzz Requires: perl(DBD::SQLite) Requires: pkgconfig(glib-2.0) +Requires: pkgconfig(libcurl) # FIXME: use proper Requires(pre/post/preun/...) PreReq: aaa PreReq: aaa < 3.2.1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/spec-cleaner-spec-cleaner-0.8.8/tests/out-minimal/changelog-newline.spec new/spec-cleaner-spec-cleaner-0.8.9/tests/out-minimal/changelog-newline.spec --- old/spec-cleaner-spec-cleaner-0.8.8/tests/out-minimal/changelog-newline.spec 1970-01-01 01:00:00.000000000 +0100 +++ new/spec-cleaner-spec-cleaner-0.8.9/tests/out-minimal/changelog-newline.spec 2016-06-05 15:50:10.000000000 +0200 @@ -0,0 +1 @@ +%changelog diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/spec-cleaner-spec-cleaner-0.8.8/tests/out-minimal/excludes-bracketing.spec new/spec-cleaner-spec-cleaner-0.8.9/tests/out-minimal/excludes-bracketing.spec --- old/spec-cleaner-spec-cleaner-0.8.8/tests/out-minimal/excludes-bracketing.spec 2016-05-17 10:19:38.000000000 +0200 +++ new/spec-cleaner-spec-cleaner-0.8.9/tests/out-minimal/excludes-bracketing.spec 2016-06-05 15:50:10.000000000 +0200 @@ -1,7 +1,5 @@ %bcond_with[^\s]* -%aarch64 %add_maven_depmap -%arm %attr(\s*\([^)]*\))? %build @@ -58,7 +56,6 @@ %install %install_info %install_info_delete -%ix86 %jar %java %javac @@ -108,7 +105,6 @@ %service_del_postun foo.service %set_permissions %setup -%sparc %stop_on_removal %suse_kernel_module_package %suse_update_desktop_file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/spec-cleaner-spec-cleaner-0.8.8/tests/out-minimal/macros.spec new/spec-cleaner-spec-cleaner-0.8.9/tests/out-minimal/macros.spec --- old/spec-cleaner-spec-cleaner-0.8.8/tests/out-minimal/macros.spec 2016-05-17 10:19:38.000000000 +0200 +++ new/spec-cleaner-spec-cleaner-0.8.9/tests/out-minimal/macros.spec 2016-06-05 15:50:10.000000000 +0200 @@ -1,8 +1,11 @@ +%define useful_macro() ( echo 'Useful macro has been used with arg %1' ) + %build cmake . \ -DIHATECMAKE=OFF ./configure --with-bells-and-whistles # this is not autotools ./configure --aughr +%useful_macro 15 %changelog diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/spec-cleaner-spec-cleaner-0.8.8/tests/out-minimal/requires.spec new/spec-cleaner-spec-cleaner-0.8.9/tests/out-minimal/requires.spec --- old/spec-cleaner-spec-cleaner-0.8.8/tests/out-minimal/requires.spec 2016-05-17 10:19:38.000000000 +0200 +++ new/spec-cleaner-spec-cleaner-0.8.9/tests/out-minimal/requires.spec 2016-06-05 15:50:10.000000000 +0200 @@ -8,6 +8,8 @@ BuildRequires: kkk BuildRequires: rrr >= %{version} BuildRequires: zzz +Requires: %{libname} >= %{version} +Requires: %{some_packagename} >= %{some_version} Requires: aaa < 3.2.1 Requires: bbb Requires: eee = %{version}-%{release} @@ -20,6 +22,7 @@ Requires: zzz Requires: perl(DBD::SQLite) Requires: pkgconfig(glib-2.0) +Requires: pkgconfig(libcurl) PreReq: aaa PreReq: aaa < 3.2.1 PreReq: eee = %{version}-%{release} ++++++ spec-cleaner.dsc ++++++ --- /var/tmp/diff_new_pack.x3MfmV/_old 2016-06-07 23:49:21.000000000 +0200 +++ /var/tmp/diff_new_pack.x3MfmV/_new 2016-06-07 23:49:21.000000000 +0200 @@ -1,6 +1,6 @@ Format: 3.0 (quilt) Source: spec-cleaner -Version: 0.8.8-1 +Version: 0.8.9-1 Binary: spec-cleaner Maintainer: Přemysl Janouch <pjano...@suse.com> Architecture: all