Merge "Move pypi to dib-python"
This commit is contained in:
commit
4afcba1fea
2 changed files with 9 additions and 1 deletions
1
diskimage_builder/elements/pypi/element-deps
Normal file
1
diskimage_builder/elements/pypi/element-deps
Normal file
|
@ -0,0 +1 @@
|
|||
dib-python
|
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/env python
|
||||
#!/usr/local/bin/dib-python
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
|
@ -16,6 +16,11 @@ from __future__ import print_function
|
|||
|
||||
import os.path
|
||||
|
||||
try:
|
||||
from urllib.parse import urlparse
|
||||
except ImportError:
|
||||
from urlparse import urlparse
|
||||
|
||||
|
||||
def main():
|
||||
home = os.path.expanduser("~")
|
||||
|
@ -49,6 +54,7 @@ def main():
|
|||
output.write('[global]\n')
|
||||
output.write('log = %s/pip.log\n' % (home,))
|
||||
output.write('index-url = %s\n' % (indices[0],))
|
||||
output.write('trusted-host = %s\n' % (urlparse(indices[0]).hostname,))
|
||||
if retries is not None:
|
||||
output.write('retries = %s\n' % retries)
|
||||
for index in indices[1:]:
|
||||
|
@ -56,6 +62,7 @@ def main():
|
|||
with open(home + '/.pydistutils.cfg', 'wt') as output:
|
||||
output.write('[easy_install]\n')
|
||||
output.write('index_url = %s\n' % (easy_index,))
|
||||
output.write('allow_hosts = %s\n' % (urlparse(easy_index).netloc,))
|
||||
|
||||
|
||||
def backup_configs(home):
|
Loading…
Reference in a new issue