Boost logo

Boost-Commit :

From: grafikrobot_at_[hidden]
Date: 2007-11-23 15:43:38


Author: grafik
Date: 2007-11-23 15:43:38 EST (Fri, 23 Nov 2007)
New Revision: 41318
URL: http://svn.boost.org/trac/boost/changeset/41318

Log:
Add --skip-script-download option to run.py to avoid repeated regression script downloads. Thanks to _m_ for the changes.
Text files modified:
   trunk/tools/regression/src/run.py | 53 +++++++++++++++++++++++----------------
   1 files changed, 31 insertions(+), 22 deletions(-)

Modified: trunk/tools/regression/src/run.py
==============================================================================
--- trunk/tools/regression/src/run.py (original)
+++ trunk/tools/regression/src/run.py 2007-11-23 15:43:38 EST (Fri, 23 Nov 2007)
@@ -12,6 +12,13 @@
 import sys
 import urllib
 
+#~ Using --skip-script-download is useful to avoid repeated downloading of
+#~ the regression scripts when doing the regression commands individually.
+no_update_argument = "--skip-script-download"
+no_update = no_update_argument in sys.argv
+if no_update:
+ del sys.argv[sys.argv.index(no_update_argument)]
+
 #~ The directory this file is in.
 root = os.path.abspath(os.path.dirname(os.path.realpath(__file__)))
 print '# Running regressions in %s...' % root
@@ -21,28 +28,30 @@
 script_remote = 'http://svn.boost.org/svn/boost/trunk/tools/regression/src'
 script_dir = os.path.join(root,'tools_regression_src')
 
-#~ Bootstrap.
-#~ * Clear out any old versions of the scripts
-print '# Creating regression scripts at %s...' % script_dir
-if os.path.exists(script_dir):
- shutil.rmtree(script_dir)
-os.mkdir(script_dir)
-#~ * Get new scripts, either from local working copy, or from svn
-if os.path.exists(script_local):
- print '# Copying regression scripts from %s...' % script_local
- for src in script_sources:
- shutil.copyfile( os.path.join(script_local,src), os.path.join(script_dir,src) )
-else:
- print '# Dowloading regression scripts from %s...' % script_remote
- proxy = None
- for a in sys.argv[1:]:
- if a.startswith('--proxy='):
- proxy = {'http' : a.split('=')[1] }
- print '--- %s' %(proxy['http'])
- break
- for src in script_sources:
- urllib.FancyURLopener(proxy).retrieve(
- '%s/%s' % (script_remote,src), os.path.join(script_dir,src) )
+if not no_update:
+ #~ Bootstrap.
+ #~ * Clear out any old versions of the scripts
+ print '# Creating regression scripts at %s...' % script_dir
+ if os.path.exists(script_dir):
+ shutil.rmtree(script_dir)
+ os.mkdir(script_dir)
+ #~ * Get new scripts, either from local working copy, or from svn
+ if os.path.exists(script_local):
+ print '# Copying regression scripts from %s...' % script_local
+ for src in script_sources:
+ shutil.copyfile( os.path.join(script_local,src), os.path.join(script_dir,src) )
+ else:
+ print '# Dowloading regression scripts from %s...' % script_remote
+ proxy = None
+ for a in sys.argv[1:]:
+ if a.startswith('--proxy='):
+ proxy = {'http' : a.split('=')[1] }
+ print '--- %s' %(proxy['http'])
+ break
+ for src in script_sources:
+ urllib.FancyURLopener(proxy).retrieve(
+ '%s/%s' % (script_remote,src), os.path.join(script_dir,src) )
+
 #~ * Make the scripts available to Python
 sys.path.insert(0,os.path.join(root,'tools_regression_src'))
 


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk