1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-01-25 22:36:13 +01:00
Add "--ccache" option to "osc getbinaries".
This commit is contained in:
Marcus Huewe 2020-05-27 16:09:06 +02:00
commit 1d26cb3079
2 changed files with 8 additions and 3 deletions

View File

@ -7250,6 +7250,8 @@ Please submit there instead, or use --nodevelproject to force direct submission.
help='also fetch source packages')
@cmdln.option('--debug', action="store_true",
help='also fetch debug packages')
@cmdln.option('--ccache', action="store_true",
help='allow fetching ccache archive')
def do_getbinaries(self, subcmd, opts, *args):
"""${cmd_name}: Download binaries to a local directory
@ -7330,7 +7332,7 @@ Please submit there instead, or use --nodevelproject to force direct submission.
for arch in arches:
for pac in package:
binaries = get_binarylist(apiurl, project, repository, arch,
package=pac, verbose=True)
package=pac, verbose=True, withccache=opts.ccache)
if not binaries:
print('no binaries found: Either the package %s ' \
'does not exist or no binaries have been built.' % pac, file=sys.stderr)

View File

@ -5654,9 +5654,12 @@ def get_repos_of_project(apiurl, prj):
for node2 in node.findall('arch'):
yield Repo(node.get('name'), node2.text)
def get_binarylist(apiurl, prj, repo, arch, package=None, verbose=False):
def get_binarylist(apiurl, prj, repo, arch, package=None, verbose=False, withccache=False):
what = package or '_repository'
u = makeurl(apiurl, ['build', prj, repo, arch, what])
query = {}
if withccache:
query['withccache'] = 1
u = makeurl(apiurl, ['build', prj, repo, arch, what], query=query)
f = http_GET(u)
tree = ET.parse(f)
if not verbose: