From ad54eca1ab079c5515ab7494f87c9ed601238cb6 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Fri, 3 Jan 2014 01:24:17 +0000 Subject: [PATCH] Only update the bootstrap script on request. Fixes #9535. --- setup.py | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/setup.py b/setup.py index f012bb6456..a8f75a63be 100755 --- a/setup.py +++ b/setup.py @@ -106,28 +106,39 @@ exec(compile(open(SALT_SYSPATHS).read(), SALT_SYSPATHS, 'exec')) class CloudSdist(sdist): user_options = sdist.user_options + [ ('skip-bootstrap-download', None, - 'Skip downloading the bootstrap-salt.sh script. This can also be ' - 'triggered by having `SKIP_BOOTSTRAP_DOWNLOAD=1` as an environment ' - 'variable.') + '[DEPRECATED] Skip downloading the bootstrap-salt.sh script. This ' + 'can also be triggered by having `SKIP_BOOTSTRAP_DOWNLOAD=1` as an ' + 'environment variable.'), + ('download-bootstrap-script', None, + 'Download the latest stable bootstrap-salt.sh script. This ' + 'can also be triggered by having `DOWNLOAD_BOOTSTRAP_SCRIPT=1` as an ' + 'environment variable.') + ] boolean_options = sdist.boolean_options + [ - 'skip-bootstrap-download' + 'skip-bootstrap-download', + 'download-bootstrap-script' ] def initialize_options(self): sdist.initialize_options(self) - self.skip_bootstrap_download = False + self.skip_bootstrap_download = True + self.download_bootstrap_script = False def finalize_options(self): sdist.finalize_options(self) if 'SKIP_BOOTSTRAP_DOWNLOAD' in os.environ: - skip_bootstrap_download = os.environ.get( - 'SKIP_BOOTSTRAP_DOWNLOAD', '0' + log('Please stop using \'SKIP_BOOTSTRAP_DOWNLOAD\' and use ' + '\'DOWNLOAD_BOOTSTRAP_SCRIPT\' instead') + + if 'DOWNLOAD_BOOTSTRAP_SCRIPT' in os.environ: + download_bootstrap_script = os.environ.get( + 'DOWNLOAD_BOOTSTRAP_SCRIPT', '0' ) - self.skip_bootstrap_download = skip_bootstrap_download == '1' + self.download_bootstrap_script = download_bootstrap_script == '1' def run(self): - if self.skip_bootstrap_download is False: + if self.download_bootstrap_script is True: # Let's update the bootstrap-script to the version defined to be # distributed. See BOOTSTRAP_SCRIPT_DISTRIBUTED_VERSION above. url = (