Merge branch 'master' into mead
This commit is contained in:
commit
c08239177a
1 changed files with 38 additions and 14 deletions
|
|
@ -128,7 +128,11 @@ def get_options():
|
|||
parser.add_option("--rules-blacklist",
|
||||
help=_("blacklist rules"))
|
||||
parser.add_option("--rules-ignorelist",
|
||||
help=_("Rules list of packages to ignore"))
|
||||
help=_("Rules: list of packages to ignore"))
|
||||
parser.add_option("--rules-includelist",
|
||||
help=_("Rules: list of packages to always include"))
|
||||
parser.add_option("--rules-protectlist",
|
||||
help=_("Rules: list of package names to never replace"))
|
||||
parser.add_option("--tag-build", action="store_true", default=False,
|
||||
help=_("tag sucessful builds into the tag we are building, default is to not tag"))
|
||||
parser.add_option("--arches",
|
||||
|
|
@ -561,6 +565,8 @@ class BuildTracker(object):
|
|||
self.whitelist = None
|
||||
self.greylist = None
|
||||
self.ignorelist = []
|
||||
self.includelist = []
|
||||
self.protectlist = []
|
||||
self.substitute_idx = {}
|
||||
self.substitutions = {}
|
||||
if options.config.has_option('rules', 'whitelist'):
|
||||
|
|
@ -571,6 +577,10 @@ class BuildTracker(object):
|
|||
self.greylist = options.config.get('rules', 'greylist').split()
|
||||
if options.config.has_option('rules', 'ignorelist'):
|
||||
self.ignorelist = options.config.get('rules', 'ignorelist').split()
|
||||
if options.config.has_option('rules', 'includelist'):
|
||||
self.includelist = options.config.get('rules', 'includelist').split()
|
||||
if options.config.has_option('rules', 'protectlist'):
|
||||
self.protectlist = options.config.get('rules', 'protectlist').split()
|
||||
if options.config.has_option('rules', 'substitutions'):
|
||||
#At present this is a simple multi-line format
|
||||
#one substitution per line
|
||||
|
|
@ -710,19 +720,23 @@ class BuildTracker(object):
|
|||
print "%sBlocked build %s%s" % (head, build.nvr, tail)
|
||||
build.setState('blocked')
|
||||
return build
|
||||
#check to see if a substition applies
|
||||
replace = self.substitutions.get(build.nvr)
|
||||
if replace:
|
||||
build.substitute = replace
|
||||
if depth > 0:
|
||||
print "%sDep replaced: %s->%s" % (head, build.nvr, replace)
|
||||
return build
|
||||
if options.prefer_new and not options.build:
|
||||
latestBuild = self.newerBuild(build, tag)
|
||||
if latestBuild != None:
|
||||
build.substitute = latestBuild.nvr
|
||||
print "%sNewer build replaced: %s->%s" % (head, build.nvr, latestBuild.nvr)
|
||||
return build
|
||||
#make sure we dont have the build name protected
|
||||
if build.name not in self.protectlist:
|
||||
#check to see if a substition applies
|
||||
replace = self.substitutions.get(build.nvr)
|
||||
if replace:
|
||||
build.substitute = replace
|
||||
if depth > 0:
|
||||
print "%sDep replaced: %s->%s" % (head, build.nvr, replace)
|
||||
return build
|
||||
if options.prefer_new and not options.build:
|
||||
latestBuild = self.newerBuild(build, tag)
|
||||
if latestBuild != None:
|
||||
build.substitute = latestBuild.nvr
|
||||
print "%sNewer build replaced: %s->%s" % (head, build.nvr, latestBuild.nvr)
|
||||
return build
|
||||
else:
|
||||
print "%sProtected Build: %s" % (head, build.nvr)
|
||||
if build.state == "common":
|
||||
#we're good
|
||||
if build.rebuilt:
|
||||
|
|
@ -752,6 +766,16 @@ class BuildTracker(object):
|
|||
#scan its deps
|
||||
print "%sMissing build %s%s. Scanning deps..." % (head, build.nvr, tail)
|
||||
newdeps = []
|
||||
# include extra local builds as deps.
|
||||
if self.includelist:
|
||||
for dep in self.includelist:
|
||||
info = session.getBuild(dep)
|
||||
if info:
|
||||
print "%s Adding local Dep %s%s" % (head, dep, tail)
|
||||
extradep = LocalBuild(info)
|
||||
newdeps.append(extradep)
|
||||
else:
|
||||
print "%s Warning: could not find build for %s" % (head, dep)
|
||||
#don't actually set build.revised_deps until we finish the dep scan
|
||||
for dep_id in build.deps:
|
||||
dep = self.scanBuild(dep_id, from_build=build, depth=depth+1, tag=tag)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue