- make the list of files ignored in the local Maven repo configurable

- add files created by Maven 3 to the default ignore list
This commit is contained in:
Mike Bonnet 2011-02-24 14:27:32 -05:00
parent 35d4aa0739
commit e7e82c452d

View file

@ -464,22 +464,23 @@ class BuildRoot(object):
- maven_info: a dict of Maven info containing the groupId, artifactId, and version fields
- files: a list of files associated with that POM
"""
patterns = self.options.maven_repo_ignore.split()
packages = []
for path, dirs, files in os.walk(repodir):
relpath = path[len(repodir) + 1:]
maven_files = []
for repofile in files:
if os.path.splitext(repofile)[1] in ('.md5', '.sha1'):
# generated by the Koji, not tracked
continue
elif fnmatch(repofile, 'maven-metadata*.xml'):
# Maven throws these metadata files around all over the place, ignore them
continue
elif relpath == '' and (fnmatch(repofile, '*-sources.zip') or fnmatch(repofile, '*-patches.zip')):
ignore = False
for pattern in patterns:
if fnmatch(repofile, pattern):
ignore = True
break
if relpath == '' and (fnmatch(repofile, '*-sources.zip') or
fnmatch(repofile, '*-patches.zip')):
# special-case the archives of the sources and patches, since we drop them in
# root of the output directory
continue
else:
ignore = True
if not ignore:
maven_files.append({'path': relpath, 'filename': repofile,
'size': os.path.getsize(os.path.join(path, repofile))})
if maven_files:
@ -2793,6 +2794,7 @@ def get_options():
'createrepo_update': True,
'pkgurl': None,
'allowed_scms': '',
'maven_repo_ignore': '*.md5 *.sha1 maven-metadata*.xml _maven.repositories resolver-status.properties',
'cert': '/etc/kojid/client.crt',
'ca': '/etc/kojid/clientca.crt',
'serverca': '/etc/kojid/serverca.crt'}