subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hwri...@apache.org
Subject svn commit: r1135468 - /subversion/trunk/tools/dist/release.py
Date Tue, 14 Jun 2011 10:40:19 GMT
Author: hwright
Date: Tue Jun 14 10:40:18 2011
New Revision: 1135468

URL: http://svn.apache.org/viewvc?rev=1135468&view=rev
Log:
release.py: use a loop where appropriate.

* tools/dist/release.py
  (RollDep, AutoconfDep, LibtoolDep, SwigDep): Update reference to self.label.
  (build_env): Iterate over the list of deps, rather than doing so manually.

Modified:
    subversion/trunk/tools/dist/release.py

Modified: subversion/trunk/tools/dist/release.py
URL: http://svn.apache.org/viewvc/subversion/trunk/tools/dist/release.py?rev=1135468&r1=1135467&r2=1135468&view=diff
==============================================================================
--- subversion/trunk/tools/dist/release.py (original)
+++ subversion/trunk/tools/dist/release.py Tue Jun 14 10:40:18 2011
@@ -126,7 +126,7 @@ class RollDep(object):
         # Extract tarball
         tarfile.open(tarball).extractall(tempdir)
 
-        logging.info('Building ' + self._label)
+        logging.info('Building ' + self.label)
         os.chdir(os.path.join(tempdir, self._filebase))
         run_script(self._verbose,
                    '''./configure --prefix=%s %s
@@ -140,7 +140,7 @@ class RollDep(object):
 class AutoconfDep(RollDep):
     def __init__(self, base_dir, use_existing, verbose):
         RollDep.__init__(self, base_dir, use_existing, verbose)
-        self._label = 'autoconf'
+        self.label = 'autoconf'
         self._filebase = 'autoconf-' + autoconf_ver
         self._url = 'http://ftp.gnu.org/gnu/autoconf/%s.tar.gz' % self._filebase
 
@@ -157,7 +157,7 @@ class AutoconfDep(RollDep):
 class LibtoolDep(RollDep):
     def __init__(self, base_dir, use_existing, verbose):
         RollDep.__init__(self, base_dir, use_existing, verbose)
-        self._label = 'libtool'
+        self.label = 'libtool'
         self._filebase = 'libtool-' + libtool_ver
         self._url = 'http://ftp.gnu.org/gnu/libtool/%s.tar.gz' % self._filebase
 
@@ -168,7 +168,7 @@ class LibtoolDep(RollDep):
 class SwigDep(RollDep):
     def __init__(self, base_dir, use_existing, verbose, sf_mirror):
         RollDep.__init__(self, base_dir, use_existing, verbose)
-        self._label = 'swig'
+        self.label = 'swig'
         self._filebase = 'swig-' + swig_ver
         self._url = 'http://sourceforge.net/projects/swig/files/swig/%(swig)s/%(swig)s.tar.gz/download?use_mirror=%(sf_mirror)s'
% \
             { 'swig' : self._filebase,
@@ -200,23 +200,12 @@ def build_env(base_dir, args):
     libtool = LibtoolDep(base_dir, args.use_existing, args.verbose)
     swig = SwigDep(base_dir, args.use_existing, args.verbose, args.sf_mirror)
 
-    # Check to see if the system versions of the stuff we're downloading will
-    # suffice
-
-    if autoconf.use_system():
-        logging.info('Using system autoconf-' + autoconf_ver)
-    else:
-        autoconf.build()
-
-    if libtool.use_system():
-        logging.info('Using system libtool-' + libtool_ver)
-    else:
-        libtool.build()
-
-    if swig.use_system():
-        logging.info('Using system swig-' + swig_ver)
-    else:
-        swig.build()
+    # iterate over our rolling deps, and build them if needed
+    for dep in [autoconf, libtool, swig]:
+        if dep.use_system():
+            logging.info('Using system %s' % dep.label)
+        else:
+            dep.build()
 
 
 def roll_tarballs(base_dir, args):



Mime
View raw message