#321 remove EL5 references
Merged 5 years ago by ngompa. Opened 5 years ago by msuchy.
msuchy/FedoraReview el5removal  into  devel

file modified
+1 -1
@@ -102,7 +102,7 @@ 

  from previous run instead.

  .TP 4

  .B -D, --define <flag[=value]>

- Define a flag e. g., EPEL5. A flag can either just be activated

+ Define a flag e. g., EPEL7. A flag can either just be activated

  using

  flag

  or set to a value using

file modified
+2 -2
@@ -64,7 +64,7 @@ 

              rpm = RpmFile(pkg, nvr.version, nvr.release)

              if not self.rpms.find_re(self.sofiles_regex, pkg):

                  continue

-             if self.flags['EPEL5'] or self.flags['EPEL6'] \

+             if self.flags['EPEL6'] \

                  or self.flags['EPEL7']:

                  if not rpm.post or '/sbin/ldconfig' not in rpm.post or \

                      not rpm.postun or '/sbin/ldconfig' not in rpm.postun:
@@ -74,7 +74,7 @@ 

                      or (rpm.postun and '/sbin/ldconfig' in rpm.postun):

                          bad_pkgs.append(pkg)

  

-         if self.flags['EPEL5'] or self.flags['EPEL6'] \

+         if self.flags['EPEL6'] \

              or self.flags['EPEL7']:

              if bad_pkgs:

                  self.set_passed(self.FAIL,

file modified
+15 -50
@@ -54,7 +54,6 @@ 

      group = 'Generic'

  

      def register_flags(self):

-         epel5 = self.Flag('EPEL5', 'Review package for EPEL5', __file__)

          epel6 = self.Flag('EPEL6', 'Review package for EPEL6', __file__)

          epel7 = self.Flag('EPEL7', 'Review package for EPEL7', __file__)

          disttag = self.Flag('DISTTAG',
@@ -230,16 +229,9 @@ 

          self.log.debug('regex: %s', regex)

          self.log.debug('install_sec: %s', install_sec)

          has_clean = install_sec and re.search(regex, install_sec)

-         if self.flags['EPEL5']:

-             self.text = 'EPEL5: Package does run rm -rf %{buildroot}' \

-                         ' (or $RPM_BUILD_ROOT) at the beginning of %install.'

-         if has_clean and self.flags['EPEL5']:

-             self.set_passed(self.PASS)

-         elif has_clean and not self.flags['EPEL5']:

+         if has_clean:

              self.set_passed(self.PENDING,

                              'rm -rf %{buildroot} present but not required')

-         elif not has_clean and self.flags['EPEL5']:

-             self.set_passed(self.FAIL)

          else:

              self.set_passed(self.PASS)

  
@@ -702,7 +694,7 @@ 

          GenericCheckBase.__init__(self, base)

          self.url = 'https://docs.fedoraproject.org/en-US' \

                     '/packaging-guidelines/LicensingGuidelines/#_license_text'

-         if not (self.flags['EPEL5'] or self.flags['EPEL6']):

+         if not self.flags['EPEL6']:

              self._license_flag = 'L'

              self._license_macro = '%license'

          else:
@@ -719,7 +711,7 @@ 

  

      def run(self):

          """ Check if there is a license file and if it is present in the

-         %license section (%doc for EPEL5 and EPEL6).

+         %license section (%doc for  EPEL6).

          """

          # pylint: disable=invalid-name

  
@@ -1178,33 +1170,6 @@ 

              self.set_passed(self.PASS)

  

  

- class CheckReqPkgConfig(GenericCheckBase):

-     '''

-     rpm in EPEL5 and below does not automatically create dependencies

-     for pkgconfig files.  Packages containing pkgconfig(.pc) files

-     must Requires: pkgconfig (for directory ownership and usability).

-     '''

-     def __init__(self, base):

-         GenericCheckBase.__init__(self, base)

-         self.url = 'https://fedoraproject.org/wiki/' \

-                    'EPEL/GuidelinesAndPolicies#EL5'

-         self.text = 'EPEL5: Package requires pkgconfig, if .pc files' \

-                     ' are present.'

-         self.automatic = True

-         self.type = 'MUST'

- 

-     def run(self):

-         if not self.rpms.find('*.pc') or not self.flags['EPEL5']:

-             self.set_passed(self.NA)

-             return

-         result = self.FAIL

-         for line in self.spec.get_requires():

-             if 'pkgconfig' in line:

-                 result = self.PASS

-                 break

-         self.set_passed(result)

- 

- 

  class CheckRequires(GenericCheckBase):

      '''

      https://docs.fedoraproject.org/en-US/packaging-guidelines/#_explicit_requires
@@ -1568,7 +1533,7 @@ 

              if self.rpms.find('/usr/share/icons/*', pkg):

                  using.append(pkg)

                  rpm_pkg = self.rpms.get(pkg)

-                 if self.flags['EPEL5'] or self.flags['EPEL6'] \

+                 if self.flags['EPEL6'] \

                      or self.flags['EPEL7']:

                      if not in_list('gtk-update-icon-cache',

                                     [rpm_pkg.postun, rpm_pkg.posttrans]):
@@ -1581,7 +1546,7 @@ 

              self.set_passed(self.NA)

              return

          text = "icons in " + ', '.join(using)

-         if self.flags['EPEL5'] or self.flags['EPEL6'] or self.flags['EPEL7']:

+         if self.flags['EPEL6'] or self.flags['EPEL7']:

              self.set_passed(self.FAIL if failed else self.PENDING, text)

          else:

              self.url = ''
@@ -1633,7 +1598,7 @@ 

              if dt_files:

                  using.append(pkg)

                  rpm_pkg = self.rpms.get(pkg)

-                 if self.flags['EPEL5'] or self.flags['EPEL6'] \

+                 if self.flags['EPEL6'] \

                      or self.flags['EPEL7']:

                      if not in_list('update-desktop-database',

                                     [rpm_pkg.post, rpm_pkg.postun]):
@@ -1646,7 +1611,7 @@ 

              self.set_passed(self.NA)

              return

          text = "desktop file(s) with MimeType entry in " + ', '.join(using)

-         if self.flags['EPEL5'] or self.flags['EPEL6'] or self.flags['EPEL7']:

+         if self.flags['EPEL6'] or self.flags['EPEL7']:

              self.set_passed(self.FAIL if failed else self.PENDING, text)

          else:

              self.url = 'https://fedoraproject.org/w/index.php?title=' \
@@ -1677,7 +1642,7 @@ 

              if self.rpms.find(gio_pattern, pkg):

                  using.append(pkg)

                  rpmpkg = self.rpms.get(pkg)

-                 if self.flags['EPEL5'] or self.flags['EPEL6'] \

+                 if self.flags['EPEL6'] \

                      or self.flags['EPEL7']:

                      if not in_list('gio-querymodules',

                                     [rpmpkg.post, rpmpkg.postun]):
@@ -1690,7 +1655,7 @@ 

              self.set_passed(self.NA)

              return

          text = "gio module file(s) in " + ', '.join(using)

-         if self.flags['EPEL5'] or self.flags['EPEL6'] or self.flags['EPEL7']:

+         if self.flags['EPEL6'] or self.flags['EPEL7']:

              self.set_passed(self.FAIL if failed else self.PENDING, text)

          else:

              self.url = 'https://fedoraproject.org/w/index.php?title=' \
@@ -1721,7 +1686,7 @@ 

              if self.rpms.find(pattern, pkg):

                  using.append(pkg)

                  rpmpkg = self.rpms.get(pkg)

-                 if self.flags['EPEL5'] or self.flags['EPEL6'] \

+                 if self.flags['EPEL6'] \

                      or self.flags['EPEL7']:

                      if not in_list('gtk-query-immodules',

                                     [rpmpkg.postun, rpmpkg.posttrans]):
@@ -1735,7 +1700,7 @@ 

              self.set_passed(self.NA)

              return

          text = "Gtk module file(s) in " + ', '.join(using)

-         if self.flags['EPEL5'] or self.flags['EPEL6'] or self.flags['EPEL7']:

+         if self.flags['EPEL6'] or self.flags['EPEL7']:

              self.set_passed(self.FAIL if failed else self.PENDING, text)

          else:

              self.url = 'https://fedoraproject.org/w/index.php?title=' \
@@ -1765,7 +1730,7 @@ 

              if self.rpms.find('*.gschema.xml', pkg):

                  using.append(pkg)

                  rpm_pkg = self.rpms.get(pkg)

-                 if self.flags['EPEL5'] or self.flags['EPEL6'] \

+                 if self.flags['EPEL6'] \

                      or self.flags['EPEL7']:

                      if not in_list('glib-compile-schemas',

                                     [rpm_pkg.postun, rpm_pkg.posttrans]):
@@ -1779,7 +1744,7 @@ 

              self.set_passed(self.NA)

              return

          text = 'gschema file(s) in ' + ', '.join(using)

-         if self.flags['EPEL5'] or self.flags['EPEL6'] or self.flags['EPEL7']:

+         if self.flags['EPEL6'] or self.flags['EPEL7']:

              self.set_passed(self.FAIL if failed else self.PENDING, text)

          else:

              self.url = 'https://fedoraproject.org/w/index.php?title=' \
@@ -1868,7 +1833,7 @@ 

              if self.rpms.find(pattern, pkg):

                  using.append(pkg)

                  rpmpkg = self.rpms.get(pkg)

-                 if self.flags['EPEL5'] or self.flags['EPEL6'] \

+                 if self.flags['EPEL6'] \

                      or self.flags['EPEL7']:

                      if not in_list('gdk-pixbuf-query-loaders',

                                     [rpmpkg.postun, rpmpkg.post]):
@@ -1882,7 +1847,7 @@ 

              self.set_passed(self.NA)

              return

          text = "gdk-pixbux module file(s) in " + ', '.join(using)

-         if self.flags['EPEL5'] or self.flags['EPEL6'] or self.flags['EPEL7']:

+         if self.flags['EPEL6'] or self.flags['EPEL7']:

              self.set_passed(self.FAIL if failed else self.PENDING, text)

          else:

              self.url = 'https://fedoraproject.org/w/index.php?title=' \

file modified
+10 -32
@@ -80,16 +80,9 @@ 

          self.type = 'SHOULD'

  

      def run(self):

-         if self.flags['EPEL5']:

-             self.text = \

-                 "Explicit BuildRoot: tag as required by EPEL5 present."

          br_tags = self.spec.find_all_re('^BuildRoot')

          if not br_tags:

-             if self.flags['EPEL5']:

-                 self.set_passed(self.FAIL,

-                                 'Missing buildroot (required for EPEL5)')

-             else:

-                 self.set_passed(self.PASS)

+             self.set_passed(self.PASS)

              return

          elif len(br_tags) > 1:

              self.set_passed(self.FAIL,
@@ -105,18 +98,15 @@ 

              '%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)',

              '%{_tmppath}/%{name}-%{version}-%{release}-root']

          if br in legal_buildroots:

-             if self.flags['EPEL5']:

-                 self.set_passed(self.PASS)

-             else:

-                 self.set_passed(self.PENDING,

-                                 'Buildroot: present but not needed')

+             self.set_passed(self.PENDING,

+                             'Buildroot: present but not needed')

          else:

              self.set_passed(self.FAIL,

                              'Invalid buildroot found: %s' % br)

  

  

  class CheckClean(GenericShouldCheckBase):

-     ''' Package has or has not %clean depending on EPEL5. '''

+     ''' Package has not %clean. '''

  

      def __init__(self, base):

          GenericShouldCheckBase.__init__(self, base)
@@ -137,20 +127,11 @@ 

              regex = r'rm\s+\-[rf][rf]\s+(%{buildroot}|\$RPM_BUILD_ROOT)'

              regex = regex.replace('%{buildroot}', buildroot)

              has_clean = re.search(regex, sec_clean)

-         if self.flags['EPEL5']:

-             self.text = 'EPEL5 requires explicit %clean with rm -rf' \

-                             ' %{buildroot} (or $RPM_BUILD_ROOT)'

-             self.type = 'MUST'

-             if has_clean:

-                 self.set_passed(self.PASS)

-             else:

-                 self.set_passed(self.FAIL)

+         if has_clean:

+             self.set_passed(self.PENDING,

+                             '%clean present but not required')

          else:

-             if has_clean:

-                 self.set_passed(self.PENDING,

-                                 '%clean present but not required')

-             else:

-                 self.set_passed(self.PASS)

+             self.set_passed(self.PASS)

  

  

  class CheckContainsLicenseText(GenericShouldCheckBase):
@@ -685,9 +666,6 @@ 

          self.type = 'SHOULD'

  

      def run(self):

-         if self.flags['EPEL5']:

-             self.set_passed(self.NA)

-             return

          for p in ['/run/*', '/var/run/*', '/var/lock/*', '/run/lock/*']:

              if self.rpms.find(p):

                  self.set_passed(self.PENDING)
@@ -766,7 +744,7 @@ 

              if self.rpms.find('/usr/share/mime/packages/*', pkg):

                  using.append(pkg)

                  rpm_pkg = self.rpms.get(pkg)

-                 if self.flags['EPEL5'] or self.flags['EPEL6'] \

+                 if self.flags['EPEL6'] \

                      or self.flags['EPEL7']:

                      if not in_list('update-mime-database',

                                     [rpm_pkg.postun, rpm_pkg.posttrans]):
@@ -780,7 +758,7 @@ 

              self.set_passed(self.NA)

              return

          text = 'mimeinfo file(s) in ' + ', '.join(using)

-         if self.flags['EPEL5'] or self.flags['EPEL6'] or self.flags['EPEL7']:

+         if self.flags['EPEL6'] or self.flags['EPEL7']:

              self.set_passed(self.FAIL if failed else self.PENDING, text)

          else:

              self.url = 'https://fedoraproject.org/w/index.php?title=' \

file modified
+2 -2
@@ -27,7 +27,7 @@ 

  

  

  class _Flag(object):

-     ''' A flag such as EPEL5, set byuser, handled by checks. '''

+     ''' A flag such as EPEL7, set byuser, handled by checks. '''

  

      def __init__(self, name, doc, defined_in):

          '''
@@ -76,7 +76,7 @@ 

      build_id = BUILD_ID

  

      class Flag(_Flag):

-         ''' A value defined in a check, set by user e. g., EPEL5. '''

+         ''' A value defined in a check, set by user e. g., EPEL7. '''

          pass

  

      def register(self, plugin):

file modified
+2 -2
@@ -118,8 +118,8 @@ 

                            ' use the ones in the cache.')

      optional.add_argument('-D', '--define', metavar='<flag>',

                            action='append', dest='flags', default=[],

-                           help='Define a flag like --define EPEL5 or '

-                           ' -D EPEL5=1')

+                           help='Define a flag like --define EPEL7 or '

+                           ' -D EPEL7=1')

      optional.add_argument('-L', '--local-repo', metavar='<rpm directory>',

                            dest='repo',

                            help='directory with rpms to install together with'

@@ -7,11 +7,11 @@ 

  # @register-flag: EPEL6  Enable EPEL6 checking

  # @register-flag: EPEL7  Enable EPEL7 checking

  # @set-flag: EPEL7 7

- if [ -n  "${FR_FLAGS[EPEL5]}" ]; then

-     echo "flags:  ${FR_FLAGS['EPEL5']}  ${FR_FLAGS['EPEL6']}"

+ if [ -n  "${FR_FLAGS[EPEL7]}" ]; then

+     echo "flags:  ${FR_FLAGS['EPEL7']}  ${FR_FLAGS['EPEL6']}"

      exit $FR_PASS

  else

-     echo EPEL5 flag is not set

+     echo EPEL7 flag is not set

      exit $FR_FAIL

  fi

  

file modified
+3 -5
@@ -205,7 +205,6 @@ 

          checks = ChecksMockup()

          checks.spec = SpecFile(os.path.join(os.getcwd(), 'disabled.spec'))

          checks.sources = SourcesDataSource(checks.spec)

-         checks.flags = {'EPEL5': False}

          check = CheckSourceComment(checks)

          check.run()

          self.assertTrue(check.is_pending)
@@ -255,7 +254,6 @@ 

                         argv=['-n', 'python-test', '--cache',

                               '--no-build'])

          checks = ChecksMockup()

-         flags = {'EPEL5': False}

          checks.log = self.log

          checks.flags = flags

          check = CheckCleanBuildroot(checks)
@@ -311,12 +309,12 @@ 

          ''' test a flag defined in python, set by user' '''

          self.init_test('test_misc',

                         argv=['-n', 'python-test', '--cache',

-                              '--no-build', '-D', 'EPEL5'])

+                              '--no-build', '-D', 'EPEL7'])

          bug = NameBug('python-test')

          bug.find_urls()

          bug.download_files()

          checks = Checks(bug.spec_file, bug.srpm_file)

-         self.assertTrue(checks.flags['EPEL5'])

+         self.assertTrue(checks.flags['EPEL7'])

  

      def test_flags_2(self):

          ''' Flag defined in python, not set by user' '''
@@ -327,7 +325,7 @@ 

          bug.find_urls()

          bug.download_files()

          checks = Checks(bug.spec_file, bug.srpm_file)

-         self.assertFalse(checks.flags['EPEL5'])

+         self.assertFalse(checks.flags['EPEL7'])

  

      def test_flags_3(self):

          ''' Flag not defined , set by user' '''

RHEL5 has been EOLed year ago. Time to move on.

Pull-Request has been merged by ngompa

5 years ago

This is incomplete.

Traceback (most recent call last):
  File "/home/churchyard/rpmbuild/FedoraReview/src/FedoraReview/review_helper.py", line 239, in run
    self._do_run(outfile)
  File "/home/churchyard/rpmbuild/FedoraReview/src/FedoraReview/review_helper.py", line 229, in _do_run
    self._do_report(outfile)
  File "/home/churchyard/rpmbuild/FedoraReview/src/FedoraReview/review_helper.py", line 98, in _do_report
    self._run_checks(self.bug.spec_file, self.bug.srpm_file, outfile)
  File "/home/churchyard/rpmbuild/FedoraReview/src/FedoraReview/review_helper.py", line 107, in _run_checks
    self.checks = Checks(spec, srpm)
  File "/home/churchyard/rpmbuild/FedoraReview/src/FedoraReview/checks.py", line 270, in __init__
    _ChecksLoader.__init__(self)
  File "/home/churchyard/rpmbuild/FedoraReview/src/FedoraReview/checks.py", line 166, in __init__
    self._load_checks()
  File "/home/churchyard/rpmbuild/FedoraReview/src/FedoraReview/checks.py", line 206, in _load_checks
    tests = registry.register(plugin)
  File "/home/churchyard/rpmbuild/FedoraReview/src/FedoraReview/registry.py", line 122, in register
    self.register_flags()
  File "/home/churchyard/rpmbuild/FedoraReview/src/FedoraReview/plugins/generic.py", line 65, in register_flags
    self.checks.flags.add(epel5)
NameError: global name 'epel5' is not defined