diff options
author | Richard Ipsum <richard.ipsum@codethink.co.uk> | 2015-01-08 11:59:00 +0000 |
---|---|---|
committer | Richard Ipsum <richard.ipsum@codethink.co.uk> | 2015-01-12 11:57:46 +0000 |
commit | 827e9904332dbd17341648be81bcf2388d241ad4 (patch) | |
tree | 2d56c8070ed02dd68dcbb475edad12a7af2839ba /baserockimport | |
parent | 0553ce72422eb55ba6389037df3290b30142dd60 (diff) | |
download | import-827e9904332dbd17341648be81bcf2388d241ad4.tar.gz |
Make python.to_lorry output x-products-python field
Diffstat (limited to 'baserockimport')
-rwxr-xr-x | baserockimport/exts/python.to_lorry | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/baserockimport/exts/python.to_lorry b/baserockimport/exts/python.to_lorry index 06ee31d..fdbd04a 100755 --- a/baserockimport/exts/python.to_lorry +++ b/baserockimport/exts/python.to_lorry @@ -112,7 +112,10 @@ def get_compression(url): def make_tarball_lorry(lorry_prefix, package_name, url): name = '%s/%s' % (lorry_prefix, package_name.lower()) - lorry = {'type': 'tarball', 'url': url} + # TODO: shouldn't have 'x-products-python' field hardcoded here either + lorry = {'type': 'tarball', + 'url': url, + 'x-products-python': [package_name.lower()]} compression = get_compression(url) if compression: lorry['compression'] = compression @@ -182,7 +185,11 @@ def generate_tarball_lorry(lorry_prefix, client, requirement): def str_repo_lorry(lorry_prefix, package_name, repo_type, url): name = '%s/%s' % (lorry_prefix, package_name.lower()) - return json.dumps({name: {'type': repo_type, 'url': url}}, + # TODO: this products field 'x-products-python' + # probably shouldn't be hardcoded here + return json.dumps({name: {'type': repo_type, + 'url': url, + 'x-products-python': [package_name.lower()]}}, indent=4, sort_keys=True) class PythonLorryExtension(ImportExtension): |