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. --- util/koji-shadow | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/util/koji-shadow b/util/koji-shadow index 6d844b3..89a67d5 100755 --- a/util/koji-shadow +++ b/util/koji-shadow @@ -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
On secondary arches it can be usef to maintain the list of packages that are built in 2 parts - one is script generated and based on values of ExclusiveArch and ExcludeArch tags in source rpms and the second is maintained manually that should be skipped for some reason (eg. not yet decided whether to fix them or add ExcludeArch/ExclusiveArch) --- util/koji-shadow | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/util/koji-shadow b/util/koji-shadow index 6d844b3..d254ae1 100755 --- a/util/koji-shadow +++ b/util/koji-shadow @@ -130,6 +130,8 @@ def get_options(): help=_("blacklist rules")) parser.add_option("--rules-ignorelist", help=_("Rules: list of packages to ignore")) + parser.add_option("--rules-excludelist", + help=_("Rules: list of packages to are excluded using ExcludeArch or ExclusiveArch")) parser.add_option("--rules-includelist", help=_("Rules: list of packages to always include")) parser.add_option("--rules-protectlist", @@ -566,6 +568,7 @@ class BuildTracker(object): self.whitelist = None self.greylist = None self.ignorelist = [] + self.excludelist = [] self.includelist = [] self.protectlist = [] self.substitute_idx = {} @@ -578,10 +581,16 @@ 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', 'excludelist'): + self.excludelist = options.config.get('rules', 'excludelist').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() + + # merge the excludelist (script generated) to the ignorelist (manually maintained) + self.ignorelist = self.ignorelist + self.excludelist + if options.config.has_option('rules', 'substitutions'): #At present this is a simple multi-line format #one substitution per line
--- util/koji-shadow | 9 +++++---- 1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/util/koji-shadow b/util/koji-shadow index 6d844b3..4b7f2e1 100755 --- a/util/koji-shadow +++ b/util/koji-shadow @@ -704,10 +704,11 @@ class BuildTracker(object): else: tail = "" head = " " * depth - if build.name in self.ignorelist: - print "%sIgnored Build: %s%s" % (head, build.nvr, tail) - build.setState('ignore') - return build + for ignored in self.ignorelist: + if (build.name == ignored) or fnmatch.fnmatch(build.name, ignored): + print "%sIgnored Build: %s%s" % (head, build.nvr, tail) + build.setState('ignore') + return build check = self.checkFilter(build, grey=None) if check is None: #greylisted builds are ok as deps, but not primary builds
When koji-shadow is run in the prefer-new mode the number of missing builds can be non-zero. Let koji-shadow finish when there are no pending builds in this case. --- util/koji-shadow | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/util/koji-shadow b/util/koji-shadow index 6d844b3..9fb66a7 100755 --- a/util/koji-shadow +++ b/util/koji-shadow @@ -1220,7 +1220,8 @@ class BuildTracker(object): initial_avail = len(self.state_idx['common']) self.report_brief() while True: - if not self.state_idx['missing'] and not self.state_idx['pending']: + if (not self.state_idx['missing'] and not self.state_idx['pending']) or \ + (options.prefer_new and not self.state_idx['pending']): #we're done break changed1 = self.checkJobs(tag)
Dan Horák píše v So 27. 10. 2012 v 15:38 +0200:
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.
util/koji-shadow | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/util/koji-shadow b/util/koji-shadow index 6d844b3..89a67d5 100755 --- a/util/koji-shadow +++ b/util/koji-shadow @@ -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"):
hm, maybe we should prefer the newer build only when the build failed or was canceled in secondary koji
latestBuild = self.newerBuild(build, tag) if latestBuild != None: build.substitute = latestBuild.nvr
Dan
buildsys@lists.fedoraproject.org