subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kot...@apache.org
Subject svn commit: r1604039 - /subversion/trunk/build/generator/gen_win_dependencies.py
Date Thu, 19 Jun 2014 22:05:32 GMT
Author: kotkov
Date: Thu Jun 19 22:05:31 2014
New Revision: 1604039

URL: http://svn.apache.org/r1604039
Log:
Fix another problem in the gen_win_dependencies.py script.  There are some
cases when we want to print a warning about an unresolved dependency, e.g.:
[[[
  WARNING: 'opensslv.h' not found
  Use '--with-openssl' to configure openssl location.
]]]

Prior to this changeset, we would instead end up with printing a stacktrace
("... global name 'show_warning' is not defined") instead of issuing a
warning and continuing to work.  The reason for that is somewhat trivial --
we inconsistently use the names 'show_warning' and 'show_warnings' across
the script and sometimes encounter a situation when the name of the function
argument does not match the name of the variable in its body.  Fix this by
using a consistent naming scheme across the whole script file.

* build/generator/gen_win_dependencies.py
  (_find_httpd, _find_openssl, _find_jdk, _find_swig, _find_serf,
   _find_sasl, _find_libintl): Use 'show_warnings' instead of 'show_warning'
    as the argument names.  The discrepancies are only in the openssl,
    jdk, and swig-related functions, but using a consistent naming scheme
    *everywhere* could probably avoid the same mistakes in the future.

Modified:
    subversion/trunk/build/generator/gen_win_dependencies.py

Modified: subversion/trunk/build/generator/gen_win_dependencies.py
URL: http://svn.apache.org/viewvc/subversion/trunk/build/generator/gen_win_dependencies.py?rev=1604039&r1=1604038&r2=1604039&view=diff
==============================================================================
--- subversion/trunk/build/generator/gen_win_dependencies.py (original)
+++ subversion/trunk/build/generator/gen_win_dependencies.py Thu Jun 19 22:05:31 2014
@@ -558,7 +558,7 @@ class GenDependenciesBase(gen_base.Gener
                                                debug_lib_dir = debug_lib_dir,
                                                defines=['XML_STATIC'])
 
-  def _find_httpd(self, show_warning):
+  def _find_httpd(self, show_warnings):
     "Find Apache HTTPD and version"
 
     minimal_httpd_version = (2, 0, 0)
@@ -582,7 +582,7 @@ class GenDependenciesBase(gen_base.Gener
     elif os.path.isfile(os.path.join(inc_base, 'ap_release.h')):
       inc_path = inc_base
     else:
-      if show_warning:
+      if show_warnings:
         print('WARNING: \'ap_release.h\' not found')
         print("Use '--with-httpd' to configure openssl location.");
       return
@@ -606,7 +606,7 @@ class GenDependenciesBase(gen_base.Gener
     httpd_version = '%d.%d.%d' % version
 
     if version < minimal_httpd_version:
-      if show_warning:
+      if show_warnings:
         print("WARNING: httpd %s or higher is required "
                         "(%s found)\n" % (
                           '.'.join(str(v) for v in minimal_httpd_version),
@@ -643,7 +643,7 @@ class GenDependenciesBase(gen_base.Gener
       # Source location
       inc_path = os.path.join(lib_base, 'modules/dav/main')
     else:
-      if show_warning:
+      if show_warnings:
         print("WARNING: Can't find mod_dav.h in the httpd directory")
         return
 
@@ -660,7 +660,7 @@ class GenDependenciesBase(gen_base.Gener
       else:
         debug_lib_dir = None
     else:
-      if show_warning:
+      if show_warnings:
         print("WARNING: Can't find mod_dav.lib in the httpd directory")
         return
 
@@ -830,7 +830,7 @@ class GenDependenciesBase(gen_base.Gener
       else:
         bin_dir = os.path.join(self.openssl_path, 'bin')
     else:
-      if show_warning:
+      if show_warnings:
         print('WARNING: \'opensslv.h\' not found')
         print("Use '--with-openssl' to configure openssl location.");
       return
@@ -1039,7 +1039,7 @@ class GenDependenciesBase(gen_base.Gener
       return
 
     if version < minimal_jdk_version:
-      if show_warning:
+      if show_warnings:
         print('Found java jdk %s, but >= %s is required. '
               'javahl will not be built.\n' % \
               (versionstr, '.'.join(str(v) for v in minimal_jdk_version)))
@@ -1096,7 +1096,7 @@ class GenDependenciesBase(gen_base.Gener
 
     swig_ver = '%d.%d.%d' % (swig_version)
     if swig_version < minimal_swig_version:
-      if show_warning:
+      if show_warnings:
         print('Found swig %s, but >= %s is required. '
               'the swig bindings will not be built.\n' %
               (swig_version, '.'.join(str(v) for v in minimal_swig_version)))
@@ -1161,7 +1161,7 @@ class GenDependenciesBase(gen_base.Gener
 
     return serf_ver_maj, serf_ver_min, serf_ver_patch
 
-  def _find_serf(self, show_warning):
+  def _find_serf(self, show_warnings):
     "Check if serf and its dependencies are available"
 
     minimal_serf_version = (1, 3, 4)
@@ -1187,7 +1187,7 @@ class GenDependenciesBase(gen_base.Gener
       lib_dir = os.path.join(self.serf_path, 'lib')
       debug_lib_dir = None
     else:
-      if show_warning:
+      if show_warnings:
         print('WARNING: \'serf.h\' not found')
         print("Use '--with-serf' to configure serf location.");
       return
@@ -1196,7 +1196,7 @@ class GenDependenciesBase(gen_base.Gener
     serf_version = '.'.join(str(v) for v in version)
 
     if version < minimal_serf_version:
-      if show_warning:
+      if show_warnings:
         print('Found serf %s, but >= %s is required. '
               'ra_serf will not be built.\n' %
               (serf_version, '.'.join(str(v) for v in minimal_serf_version)))
@@ -1216,7 +1216,7 @@ class GenDependenciesBase(gen_base.Gener
                                                 debug_lib_dir=debug_lib_dir,
                                                 defines=defines)
 
-  def _find_sasl(self, show_warning):
+  def _find_sasl(self, show_warnings):
     "Check if sals is available"
 
     minimal_sasl_version = (2, 0, 0)
@@ -1229,7 +1229,7 @@ class GenDependenciesBase(gen_base.Gener
     version_file_path = os.path.join(inc_dir, 'sasl.h')
 
     if not os.path.isfile(version_file_path):
-      if show_warning:
+      if show_warnings:
         print('WARNING: \'%s\' not found' % (version_file_path,))
         print("Use '--with-sasl' to configure sasl location.");
       return
@@ -1249,7 +1249,7 @@ class GenDependenciesBase(gen_base.Gener
     sasl_version = '.'.join(str(v) for v in version)
 
     if version < minimal_sasl_version:
-      if show_warning:
+      if show_warnings:
         print('Found sasl %s, but >= %s is required. '
               'sals support will not be built.\n' %
               (sasl_version, '.'.join(str(v) for v in minimal_serf_version)))
@@ -1274,7 +1274,7 @@ class GenDependenciesBase(gen_base.Gener
                                                dll_name=dll_name,
                                                defines=['SVN_HAVE_SASL'])
 
-  def _find_libintl(self, show_warning):
+  def _find_libintl(self, show_warnings):
     "Find gettext support"
     minimal_libintl_version = (0, 14, 1)
 
@@ -1302,7 +1302,7 @@ class GenDependenciesBase(gen_base.Gener
       lib_name = 'intl.lib'
       dll_name = 'intl.dll'
     else:
-      if (show_warning):
+      if (show_warnings):
         print('WARNING: \'libintl.h\' not found')
         print("Use '--with-libintl' to configure libintl location.")
       return
@@ -1319,7 +1319,7 @@ class GenDependenciesBase(gen_base.Gener
     libintl_version = '.'.join(str(v) for v in version)
 
     if version < minimal_libintl_version:
-      if show_warning:
+      if show_warnings:
         print('Found libintl %s, but >= %s is required.\n' % \
               (libintl_version,
                '.'.join(str(v) for v in minimal_libintl_version)))



Mime
View raw message