diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2012-03-29 23:57:57 -0400 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2012-03-29 23:57:57 -0400 |
commit | 23622dbdb01a2427ba8c40ffb9820793a6d21817 (patch) | |
tree | 5811b5fe1bf6c17407e7490d11fe826ae5f02026 | |
parent | be66b979ea6371d92a555c5fea28faa3e2b719bc (diff) | |
download | external_python_setuptools-23622dbdb01a2427ba8c40ffb9820793a6d21817.tar.gz external_python_setuptools-23622dbdb01a2427ba8c40ffb9820793a6d21817.tar.bz2 external_python_setuptools-23622dbdb01a2427ba8c40ffb9820793a6d21817.zip |
Put the setopt directives before bdist_egg
--HG--
branch : distribute
extra : rebase_source : 23f656d6eb2ade3aa51f285a8bc288eab432819a
-rwxr-xr-x | setuptools/command/easy_install.py | 34 |
1 files changed, 16 insertions, 18 deletions
diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py index ef82808b..4ff57648 100755 --- a/setuptools/command/easy_install.py +++ b/setuptools/command/easy_install.py @@ -1081,29 +1081,27 @@ See the setuptools documentation for the "develop" command for more info. raise DistutilsError("Setup script exited with %s" % (v.args[0],)) def build_and_install(self, setup_script, setup_base): - args = ['bdist_egg', '--dist-dir'] + args = [] + + # first pass along any install directives using setopt + ei_opts = self.distribution.get_option_dict('easy_install').copy() + install_directives = ( + 'find_links', 'site_dirs', 'index_url', 'optimize', + 'site_dirs', 'allow_hosts' + ) + for key, val in ei_opts.iteritems(): + if key not in install_directives: continue + args.extend(['setopt', '--command', 'easy_install', + '--option', key.replace('_', '-'), + '--set-value', val[1]]) + + args.extend(['bdist_egg', '--dist-dir']) + dist_dir = tempfile.mkdtemp( prefix='egg-dist-tmp-', dir=os.path.dirname(setup_script) ) try: args.append(dist_dir) - ei_opts = self.distribution.get_option_dict('easy_install').copy() - keep = ( - 'find_links', 'site_dirs', 'index_url', 'optimize', - 'site_dirs', 'allow_hosts' - ) - for key in ei_opts.keys(): - if key not in keep: - del ei_opts[key] - if ei_opts: - for key, val in ei_opts.iteritems(): - args.append('setopt') - args.append('--command') - args.append('easy_install') - args.append('--option') - args.append(key.replace('_', '-')) - args.append('--set-value') - args.append(val[1]) self.run_setup(setup_script, setup_base, args) all_eggs = Environment([dist_dir]) |