From f00e1b9de1a74f52de5a8b0906583f43d7840272 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Apr 24 2017 12:39:44 +0000 Subject: [PATCH 1/2] Download the source repository metadata as src_ and expose them We only document them in the index page as they provide interesting information. Fixes https://pagure.io/mdapi/issue/45 Signed-off-by: Pierre-Yves Chibon --- diff --git a/mdapi-get_repo_md b/mdapi-get_repo_md index d63c077..997035f 100755 --- a/mdapi-get_repo_md +++ b/mdapi-get_repo_md @@ -469,6 +469,9 @@ def main(): (url, release['koji_name']) ) + url = url.replace('/x86_64/os/', '/source/tree/') + repositories.append((url, 'src_%s' % release['koji_name'])) + urls = { 'Fedora': [ @@ -499,6 +502,9 @@ def main(): rurl = url % (DL_SERVER, version) repositories.append((rurl, name)) + rurl = rurl.replace('/x86_64/', '/SRPMS/') + repositories.append((rurl, 'src_%s' % name)) + # In parallel #p = multiprocessing.Pool(10) #p.map(process_repo, itertools.product( diff --git a/mdapi/index.html b/mdapi/index.html index 8a77590..4d3971c 100644 --- a/mdapi/index.html +++ b/mdapi/index.html @@ -70,6 +70,14 @@ at: /branches + +Note: + The src_* branches refer to the source repositories metadata, they will + thus return you information about the source package. + So to find the BuildRequires of a package, check its requires provided in + its information against in a src_* branch. + + Retrieve information about a package ------------------------------------ @@ -136,6 +144,7 @@ Few examples: packages requiring R in rawhide: /rawhide/requires/R + To see what R itself requires, check its information using: /rawhide/pkg/R packages providing perl(SetupLog) in rawhide: /rawhide/provides/perl(SetupLog) From c7c8711e823499d9c2e7b77cf9f18601584f2eaf Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Apr 24 2017 12:39:53 +0000 Subject: [PATCH 2/2] Order the list of branches returned Signed-off-by: Pierre-Yves Chibon --- diff --git a/mdapi/__init__.py b/mdapi/__init__.py index dc85321..ae5b2da 100644 --- a/mdapi/__init__.py +++ b/mdapi/__init__.py @@ -270,12 +270,12 @@ def list_branches(request): ''' Return the list of all branches currently supported by mdapi ''' pretty = _get_pretty(request) - output = list(set([ + output = sorted(list(set([ # Remove the front part `mdapi-` and the end part -.sqlite filename.replace('mdapi-', '').rsplit('-', 2)[0].replace('-updates', '') for filename in os.listdir(CONFIG['DB_FOLDER']) if filename.startswith('mdapi') and filename.endswith('.sqlite') - ])) + ]))) args = {} if pretty: