Author: svn-role
Date: Fri Jan  5 04:00:09 2018
New Revision: 1820248

URL: http://svn.apache.org/viewvc?rev=1820248&view=rev
Log:
Merge the r1819556 group from trunk:

 * r1819556, r1819557
   Improve external command invocation in the swig parts of the build system.
   Both gen-make.py and 'make swig-py' are affected.
   Justification:
     More robust build system (e.g., error checking in the __init__.py
     callers).
   Votes:
     +1: danielsh, jamessan, stefan2

Removed:
    subversion/branches/1.10.x/build/generator/util/executable.py
Modified:
    subversion/branches/1.10.x/   (props changed)
    subversion/branches/1.10.x/STATUS
    subversion/branches/1.10.x/build/generator/swig/__init__.py
    subversion/branches/1.10.x/build/generator/swig/checkout_swig_header.py
    subversion/branches/1.10.x/build/generator/swig/external_runtime.py

Propchange: subversion/branches/1.10.x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Jan  5 04:00:09 2018
@@ -99,4 +99,4 @@
 /subversion/branches/verify-at-commit:1462039-1462408
 /subversion/branches/verify-keep-going:1439280-1546110
 /subversion/branches/wc-collate-path:1402685-1480384
-/subversion/trunk:1817837,1817856,1818651,1818662,1818727,1818801,1818803,1818807,1818868,1818871,1819093,1819162,1819444,1819603,1819911
+/subversion/trunk:1817837,1817856,1818651,1818662,1818727,1818801,1818803,1818807,1818868,1818871,1819093,1819162,1819444,1819556-1819557,1819603,1819911

Modified: subversion/branches/1.10.x/STATUS
URL: 
http://svn.apache.org/viewvc/subversion/branches/1.10.x/STATUS?rev=1820248&r1=1820247&r2=1820248&view=diff
==============================================================================
--- subversion/branches/1.10.x/STATUS (original)
+++ subversion/branches/1.10.x/STATUS Fri Jan  5 04:00:09 2018
@@ -29,15 +29,6 @@ Veto-blocked changes:
 Approved changes:
 =================
 
- * r1819556, r1819557
-   Improve external command invocation in the swig parts of the build system.
-   Both gen-make.py and 'make swig-py' are affected.
-   Justification:
-     More robust build system (e.g., error checking in the __init__.py
-     callers).
-   Votes:
-     +1: danielsh, jamessan, stefan2
-
  * r1818578, r1819037, r1819049, r1819052
    Fix svn_dirent_t.size API inconsistency
    Justification:

Modified: subversion/branches/1.10.x/build/generator/swig/__init__.py
URL: 
http://svn.apache.org/viewvc/subversion/branches/1.10.x/build/generator/swig/__init__.py?rev=1820248&r1=1820247&r2=1820248&view=diff
==============================================================================
--- subversion/branches/1.10.x/build/generator/swig/__init__.py (original)
+++ subversion/branches/1.10.x/build/generator/swig/__init__.py Fri Jan  5 
04:00:09 2018
@@ -25,7 +25,7 @@
 import os
 import re
 import shutil
-import generator.util.executable as _exec
+import subprocess
 from generator.gen_base import _collect_paths
 try:
   # Python >=3.0
@@ -59,14 +59,19 @@ class Generator:
 
     # Calculate SWIG paths
     self.swig_path = swig_path
-    self.swig_libdir = _exec.output([self.swig_path, "-swiglib"], strip=1)
+    if os.access(self.swig_path, os.X_OK):
+      # ### TODO: What's the reason for this os.access() check?  It was added
+      # ### in r873265 (== r33191).
+      self.swig_libdir = subprocess.check_output([self.swig_path, 
"-swiglib"]).strip()
+    else:
+      self.swig_libdir = None
 
   _swigVersion = None
   def version(self):
     """Get the version number of SWIG"""
 
     if not self._swigVersion:
-      swig_version = _exec.output([self.swig_path, "-version"])
+      swig_version = subprocess.check_output([self.swig_path, "-version"])
       m = re.search("Version (\d+).(\d+).(\d+)", swig_version)
       if m:
         self._swigVersion = tuple(map(int, m.groups()))

Modified: 
subversion/branches/1.10.x/build/generator/swig/checkout_swig_header.py
URL: 
http://svn.apache.org/viewvc/subversion/branches/1.10.x/build/generator/swig/checkout_swig_header.py?rev=1820248&r1=1820247&r2=1820248&view=diff
==============================================================================
--- subversion/branches/1.10.x/build/generator/swig/checkout_swig_header.py 
(original)
+++ subversion/branches/1.10.x/build/generator/swig/checkout_swig_header.py Fri 
Jan  5 04:00:09 2018
@@ -23,13 +23,12 @@
 # Checkout files from the SWIG library into Subversion's proxy directory
 #
 
-import sys, os, re, fileinput, shutil
+import sys, os, re, fileinput, shutil, subprocess
 if __name__ == "__main__":
   parent_dir = os.path.dirname(os.path.abspath(os.path.dirname(sys.argv[0])))
   sys.path[0:0] = [ parent_dir, os.path.dirname(parent_dir) ]
 import generator.swig
 from gen_base import build_path_splitfile, build_path_join
-from generator.util.executable import run
 
 class Generator(generator.swig.Generator):
 
@@ -63,7 +62,7 @@ class Generator(generator.swig.Generator
     elif self.version() == (1, 3, 24):
       shutil.copy(build_path_join(self.swig_libdir, path), out)
     else:
-      run("%s -o %s -co %s" % (self.swig_path, out, path))
+      subprocess.check_call([self.swig_path, "-o", out, "-co", path])
 
   def _skip_checkout(self, path):
     """Should we skip this checkout?"""

Modified: subversion/branches/1.10.x/build/generator/swig/external_runtime.py
URL: 
http://svn.apache.org/viewvc/subversion/branches/1.10.x/build/generator/swig/external_runtime.py?rev=1820248&r1=1820247&r2=1820248&view=diff
==============================================================================
--- subversion/branches/1.10.x/build/generator/swig/external_runtime.py 
(original)
+++ subversion/branches/1.10.x/build/generator/swig/external_runtime.py Fri Jan 
 5 04:00:09 2018
@@ -29,13 +29,12 @@ import os
 import re
 import fileinput
 import filecmp
+import subprocess
 
 if __name__ == "__main__":
   parent_dir = os.path.dirname(os.path.abspath(os.path.dirname(sys.argv[0])))
   sys.path[0:0] = [ parent_dir, os.path.dirname(parent_dir) ]
 import generator.swig
-import generator.util.executable
-_exec = generator.util.executable
 
 class Generator(generator.swig.Generator):
   """Generate external runtime files for SWIG"""
@@ -82,7 +81,7 @@ class Generator(generator.swig.Generator
         out_file.write(open("%s/runtime.swg" % self.proxy_dir).read())
       out_file.close()
     else:
-      _exec.run("%s -%s -external-runtime %s" % (self.swig_path, lang, out))
+      subprocess.check_call([self.swig_path, "-"+lang, "-external-runtime", 
out])
 
     # SWIG 1.3.24-27 should include rubyhead.swg in their
     # external runtime, but they don't.


Reply via email to