Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 882813 Details for
Bug 1084583
[RFE][PATCH] Allow specifying an 'int' for 'latest'
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Patch that allows specifying an "int" for "latest"
0001-Allow-specifying-an-int-for-latest.patch (text/plain), 3.72 KB, created by
Ralph Bean
on 2014-04-04 18:52:45 UTC
(
hide
)
Description:
Patch that allows specifying an "int" for "latest"
Filename:
MIME Type:
Creator:
Ralph Bean
Created:
2014-04-04 18:52:45 UTC
Size:
3.72 KB
patch
obsolete
>From db7d2827ee1bfdb7ea99bd0b505f94fb38189e5b Mon Sep 17 00:00:00 2001 >From: Ralph Bean <rbean@redhat.com> >Date: Fri, 4 Apr 2014 14:48:05 -0400 >Subject: [PATCH] Allow specifying an 'int' for 'latest'. > >This should preserve the pre-existing behavior, where if latest is set >to True, only the latest builds in a tag are returned, and if latest is >set to False, all the builds in a tag are returned. > >The new behavior is a kind of middleground, where you can set latest=3, >and only the latest three builds for each package in a tag are returned. > >We want this ultimately for mashing rawhide so we can create a downgrade >path for people if new builds break them. >https://bugzilla.redhat.com/show_bug.cgi?id=1082830 >--- > hub/kojihub.py | 14 +++++++++----- > 1 file changed, 9 insertions(+), 5 deletions(-) > >diff --git a/hub/kojihub.py b/hub/kojihub.py >index 75ee5ed..13da417 100644 >--- a/hub/kojihub.py >+++ b/hub/kojihub.py >@@ -1,7 +1,7 @@ > # Python library > > # kojihub - library for koji's XMLRPC interface >-# Copyright (c) 2005-2010 Red Hat >+# Copyright (c) 2005-2014 Red Hat > # > # Koji is free software; you can redistribute it and/or > # modify it under the terms of the GNU Lesser General Public >@@ -24,6 +24,7 @@ > import base64 > import calendar > import cgi >+import collections > import koji > import koji.auth > import koji.db >@@ -1123,6 +1124,7 @@ def readTaggedBuilds(tag,event=None,inherit=False,latest=False,package=None,owne > set inherit=True to follow inheritance > set event to query at a time in the past > set latest=True to get only the latest build per package >+ set latest=N to get only the N latest tagged RPMS > > If type is not None, restrict the list to builds of the given type. Currently the supported > types are 'maven', 'win', and 'image'. >@@ -1191,7 +1193,7 @@ def readTaggedBuilds(tag,event=None,inherit=False,latest=False,package=None,owne > # i.e. latest first > > builds = [] >- seen = {} # used to enforce the 'latest' option >+ seen = collections.defaultdict(0) # used to enforce the 'latest' option > for tagid in taglist: > #log_error(koji.db._quoteparams(q,locals())) > for build in _multiRow(q, locals(), [pair[1] for pair in fields]): >@@ -1204,10 +1206,10 @@ def readTaggedBuilds(tag,event=None,inherit=False,latest=False,package=None,owne > # list should take priority > continue > if latest: >- if seen.has_key(pkgid): >- #only take the first (note ordering in query above) >+ if (latest is True and seen[pkgid]) or seen[pkgid] >= latest: >+ #only take the first N (note ordering in query above) > continue >- seen[pkgid] = 1 >+ seen[pkgid] = seen[pkgid] + 1 > builds.append(build) > > return builds >@@ -1218,6 +1220,7 @@ def readTaggedRPMS(tag, package=None, arch=None, event=None,inherit=False,latest > set inherit=True to follow inheritance > set event to query at a time in the past > set latest=False to get all tagged RPMS (not just from the latest builds) >+ set latest=N to get only the N latest tagged RPMS > > If type is not None, restrict the list to rpms from builds of the given type. Currently the > supported types are 'maven' and 'win'. >@@ -1306,6 +1309,7 @@ def readTaggedArchives(tag, package=None, event=None, inherit=False, latest=True > set inherit=True to follow inheritance > set event to query at a time in the past > set latest=False to get all tagged archives (not just from the latest builds) >+ set latest=N to get only the N latest tagged RPMS > > If type is not None, restrict the listing to archives of the given type. Currently > the supported types are 'maven' and 'win'. >-- >1.9.0 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1084583
: 882813