import Pkg
import Filter
+from common.git import clone_gitproject
+
def rpmlint(spec_file):
def __print(s):
# 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(os.getenv('GIT_CACHE_DIR'),
- os.getenv('RPMLINT_PRJ'),
- 'rpmlint')
+ 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))