Remove unused rpmlint module
authorLin Yang <lin.a.yang@intel.com>
Thu, 11 Jul 2013 06:12:46 +0000 (14:12 +0800)
committerEduard Bartosh <eduard.bartosh@intel.com>
Mon, 15 Jul 2013 09:52:17 +0000 (02:52 -0700)
Change-Id: I9ebc97aa017ddf2737de85c44ed893d08783e1da
Signed-off-by: Lin Yang <lin.a.yang@intel.com>
Reviewed-on: https://otctools.jf.intel.com/review/5441
Tested-by: OTC Tools Tester <ed.bartosh@linux.intel.com>
Reviewed-by: Eduard Bartosh <eduard.bartosh@intel.com>
common/rpmlint.py [deleted file]
packaging/jenkins-scripts.spec

diff --git a/common/rpmlint.py b/common/rpmlint.py
deleted file mode 100644 (file)
index fc9bb9a..0000000
+++ /dev/null
@@ -1,113 +0,0 @@
-#!/usr/bin/python -tt
-# vim: ai ts=4 sts=4 et sw=4
-#
-# Copyright (c) 2011 Intel, Inc.
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the Free
-# Software Foundation; version 2 of the License
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-# or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program; if not, write to the Free Software Foundation, Inc., 59
-# Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-"""A rpmlint wrapper"""
-
-import sys
-import os
-
-sys.path.insert(1, '/usr/share/rpmlint')
-
-from Filter import printed_messages, badnessThreshold
-import SpecCheck
-import Config
-import Pkg
-import Filter
-
-from common.git import clone_gitproject
-
-def rpmlint(spec_file):
-    """Lint a spec file"""
-
-    def _print(msgtype, pkg, reason, details):
-        """Print datail information"""
-
-        threshold = badnessThreshold()
-
-        badness = 0
-        if threshold >= 0:
-            badness = Config.badness(reason)
-            # anything with badness is an error
-            if badness:
-                msgtype = 'E'
-            # errors without badness become warnings
-            elif msgtype == 'E':
-                msgtype = 'W'
-
-        line_num = ""
-        if pkg.current_linenum is not None:
-            line_num = "%s:" % pkg.current_linenum
-        arch = ""
-        if pkg.arch is not None:
-            arch = ".%s" % pkg.arch
-        state = "%s%s:%s %s: %s" % (pkg.name, arch, line_num, msgtype, reason)
-        if badness:
-            state = state + " (Badness: %d)" % badness
-        for detail in details:
-            state = state + " %s" % detail
-        else:
-            if not Config.isFiltered(state):
-                outputs.append(state)
-                printed_messages[msgtype] += 1
-                if threshold >= 0:
-                    _diagnostic.append(state + "\n")
-                else:
-                    if Config.info:
-                        printDescriptions(reason)
-                return True
-
-        return False
-
-
-    Filter._print = _print
-    # spec_file=sys.argv[1]
-
-    # the tempfile is designed for python policycheck.py,
-    # bash script doesn't use it
-
-    rpmlint_prj = os.getenv('RPMLINT_PRJ')
-    git_cache_dir = os.getenv('GIT_CACHE_DIR')
-    rpmlint_config_dir = os.path.join(git_cache_dir, rpmlint_prj)
-
-    # if rpmlint_config does NOT exist, then clone it from gerrit projects.
-    if not os.path.isdir(rpmlint_config_dir):
-        clone_gitproject(rpmlint_prj, rpmlint_config_dir)
-
-    try:
-        rpmlint_config = os.path.join(git_cache_dir, rpmlint_prj, 'rpmlint')
-        if not os.path.isfile(rpmlint_config):
-            rpmlint_config = '~/.config/rpmlint'
-        execfile(os.path.expanduser(rpmlint_config))
-    except IOError:
-        pass
-
-    outputs = []
-
-    pkg = Pkg.FakePkg(spec_file)
-    check = SpecCheck.SpecCheck()
-    check.check_spec(pkg, spec_file)
-    pkg.cleanup()
-
-    msg = 'rpmlint checked %s: %d errors, %s warnings.' % (
-            spec_file, printed_messages["E"], printed_messages["W"])
-    for line in outputs:
-        line = line.strip().lstrip(spec_file+':').strip()
-        if not line.startswith('W:') and not line.startswith('E:'):
-            line = 'line '+line
-        msg += '\n- '+line
-    return msg
index 333d1a2..d4af4e0 100644 (file)
@@ -21,7 +21,6 @@ Requires:       python-cheetah
 Requires:       python-mysql
 Requires:       python-redis
 Requires:       python-yaml
-Requires:       rpmlint >= 1.3
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 BuildArch:      noarch