summaryrefslogtreecommitdiff
path: root/baserockimport/exts/python.to_lorry
diff options
context:
space:
mode:
Diffstat (limited to 'baserockimport/exts/python.to_lorry')
-rwxr-xr-xbaserockimport/exts/python.to_lorry7
1 files changed, 5 insertions, 2 deletions
diff --git a/baserockimport/exts/python.to_lorry b/baserockimport/exts/python.to_lorry
index f54e341..48367fb 100755
--- a/baserockimport/exts/python.to_lorry
+++ b/baserockimport/exts/python.to_lorry
@@ -188,16 +188,19 @@ def str_repo_lorry(package_name, repo_type, url):
indent=4, sort_keys=True)
def main(argv):
- if len(argv) != 2:
+ if len(argv) not in [2, 3]:
# TODO explain the format of python requirements
# warn the user that they probably want to quote their arg
# > < will be interpreted as redirection by the shell
- print('usage: %s requirement' % argv[0], file=sys.stderr)
+ print('usage: %s requirement [local_data_path]' % argv[0], file=sys.stderr)
sys.exit(1)
client = xmlrpclib.ServerProxy(PYPI_URL)
req = pkg_resources.parse_requirements(argv[1]).next()
+ local_data_path = argv[2] if len(argv) == 3 else None
+
+ logging.debug('local_data_path to_lorry: %s\n', local_data_path)
new_proj_name = name_or_closest(client, req.project_name)