don't replace existing build when running with prefer-new

Only try to replace a build with newer one when the required one is missing.
It also means the buildroot will be closer to the one in primary.
This commit is contained in:
Dan Horák 2012-10-27 15:38:42 +02:00 committed by Dennis Gilmore
parent f54447c34b
commit 5df0317d4e

View file

@ -730,7 +730,7 @@ class BuildTracker(object):
if depth > 0:
print "%sDep replaced: %s->%s" % (head, build.nvr, replace)
return build
if options.prefer_new and not options.build:
if options.prefer_new and not (options.build or build.state == "common"):
latestBuild = self.newerBuild(build, tag)
if latestBuild != None:
build.substitute = latestBuild.nvr