Browse Source

Merge "Fix the pypi element for multiple mirror URLs"

tags/2.26.0
Zuul 1 month ago
parent
commit
24e620ae6d

+ 4
- 2
diskimage_builder/elements/pypi/pre-install.d/04-configure-pypi-mirror View File

@@ -57,8 +57,10 @@ def main():
57 57
         output.write('trusted-host =  %s\n' % (urlparse(indices[0]).hostname,))
58 58
         if retries is not None:
59 59
             output.write('retries = %s\n' % retries)
60
-        for index in indices[1:]:
61
-            output.write('extra-index-url = %s\n' % (index,))
60
+        if len(indices) > 1:
61
+            output.write('extra-index-url =\n')
62
+            for index in indices[1:]:
63
+                output.write('    %s\n' % (index,))
62 64
     with open(home + '/.pydistutils.cfg', 'wt') as output:
63 65
         output.write('[easy_install]\n')
64 66
         output.write('index_url = %s\n' % (easy_index,))

Loading…
Cancel
Save