494b4f
# ./pullrev.sh 1834495
494b4f
http://svn.apache.org/viewvc?view=revision&revision=1834495
494b4f
494b4f
--- apr-1.6.3/buildconf
494b4f
+++ apr-1.6.3/buildconf
494b4f
@@ -112,8 +112,10 @@
494b4f
 # Remove autoconf 2.5x's cache directory
494b4f
 rm -rf autom4te*.cache
494b4f
 
494b4f
+PYTHON=${PYTHON-`build/PrintPath python3 python2 python`}
494b4f
+
494b4f
 echo "buildconf: generating 'make' outputs ..."
494b4f
-build/gen-build.py $verbose make
494b4f
+${PYTHON} build/gen-build.py $verbose make
494b4f
 
494b4f
 # Create RPM Spec file
494b4f
 if [ -f `which cut` ]; then
494b4f
--- apr-1.6.3/build/gen-build.py
494b4f
+++ apr-1.6.3/build/gen-build.py
494b4f
@@ -10,7 +10,10 @@
494b4f
 
494b4f
 
494b4f
 import os
494b4f
-import ConfigParser
494b4f
+try:
494b4f
+  import configparser
494b4f
+except ImportError:
494b4f
+  import ConfigParser as configparser
494b4f
 import getopt
494b4f
 import string
494b4f
 import glob
494b4f
@@ -36,7 +39,7 @@
494b4f
 
494b4f
 
494b4f
 def main():
494b4f
-  parser = ConfigParser.ConfigParser()
494b4f
+  parser = configparser.ConfigParser()
494b4f
   parser.read('build.conf')
494b4f
 
494b4f
   if parser.has_option('options', 'dsp'):
494b4f
@@ -62,7 +65,7 @@
494b4f
   # write out the platform-independent files
494b4f
   files = get_files(parser.get('options', 'paths'))
494b4f
   objects, dirs = write_objects(f, legal_deps, h_deps, files)
494b4f
-  f.write('\nOBJECTS_all = %s\n\n' % string.join(objects))
494b4f
+  f.write('\nOBJECTS_all = %s\n\n' % " ".join(objects))
494b4f
 
494b4f
   # for each platform and each subdirectory holding platform-specific files,
494b4f
   # write out their compilation rules, and an OBJECT_<subdir>_<plat> symbol.
494b4f
@@ -86,11 +89,11 @@
494b4f
           inherit_files[-1] = inherit_files[-1][:-2] + '.lo'
494b4f
           # replace the \\'s with /'s
494b4f
           inherit_line = '/'.join(inherit_files)
494b4f
-          if not inherit_parent.has_key(inherit_files[0]):
494b4f
+          if inherit_files[0] not in inherit_parent:
494b4f
             inherit_parent[inherit_files[0]] = []
494b4f
           inherit_parent[inherit_files[0]].append(inherit_line)
494b4f
 
494b4f
-    for subdir in string.split(parser.get('options', 'platform_dirs')):
494b4f
+    for subdir in parser.get('options', 'platform_dirs').split():
494b4f
       path = '%s/%s' % (subdir, platform)
494b4f
       if not os.path.exists(path):
494b4f
         # this subdir doesn't have a subdir for this platform, so we'll
494b4f
@@ -106,7 +109,7 @@
494b4f
       files = get_files(path + '/*.c')
494b4f
       objects, _unused = write_objects(f, legal_deps, h_deps, files)
494b4f
 
494b4f
-      if inherit_parent.has_key(subdir):
494b4f
+      if subdir in inherit_parent:
494b4f
         objects = objects + inherit_parent[subdir]
494b4f
 
494b4f
       symname = 'OBJECTS_%s_%s' % (subdir, platform)
494b4f
@@ -114,7 +117,7 @@
494b4f
       objects.sort()
494b4f
 
494b4f
       # and write the symbol for the whole group
494b4f
-      f.write('\n%s = %s\n\n' % (symname, string.join(objects)))
494b4f
+      f.write('\n%s = %s\n\n' % (symname, " ".join(objects)))
494b4f
 
494b4f
       # and include that symbol in the group
494b4f
       group.append('$(%s)' % symname)
494b4f
@@ -122,18 +125,18 @@
494b4f
     group.sort()
494b4f
 
494b4f
     # write out a symbol which contains the necessary files
494b4f
-    f.write('OBJECTS_%s = %s\n\n' % (platform, string.join(group)))
494b4f
+    f.write('OBJECTS_%s = %s\n\n' % (platform, " ".join(group)))
494b4f
 
494b4f
-  f.write('HEADERS = $(top_srcdir)/%s\n\n' % string.join(headers, ' $(top_srcdir)/'))
494b4f
-  f.write('SOURCE_DIRS = %s $(EXTRA_SOURCE_DIRS)\n\n' % string.join(dirs.keys()))
494b4f
+  f.write('HEADERS = $(top_srcdir)/%s\n\n' % ' $(top_srcdir)/'.join(headers))
494b4f
+  f.write('SOURCE_DIRS = %s $(EXTRA_SOURCE_DIRS)\n\n' % " ".join(dirs.keys()))
494b4f
 
494b4f
   if parser.has_option('options', 'modules'):
494b4f
     modules = parser.get('options', 'modules')
494b4f
 
494b4f
-    for mod in string.split(modules):
494b4f
+    for mod in modules.split():
494b4f
       files = get_files(parser.get(mod, 'paths'))
494b4f
       objects, _unused = write_objects(f, legal_deps, h_deps, files)
494b4f
-      flat_objects = string.join(objects)
494b4f
+      flat_objects = " ".join(objects)
494b4f
       f.write('OBJECTS_%s = %s\n' % (mod, flat_objects))
494b4f
 
494b4f
       if parser.has_option(mod, 'target'):
494b4f
@@ -153,9 +156,9 @@
494b4f
       d = os.path.dirname(d)
494b4f
 
494b4f
   # Sort so 'foo' is before 'foo/bar'
494b4f
-  keys = alldirs.keys()
494b4f
+  keys = list(alldirs.keys())
494b4f
   keys.sort()
494b4f
-  f.write('BUILD_DIRS = %s\n\n' % string.join(keys))
494b4f
+  f.write('BUILD_DIRS = %s\n\n' % " ".join(keys))
494b4f
 
494b4f
   f.write('.make.dirs: $(srcdir)/build-outputs.mk\n' \
494b4f
           '\t@for d in $(BUILD_DIRS); do test -d $$d || mkdir $$d; done\n' \
494b4f
@@ -177,12 +180,12 @@
494b4f
 
494b4f
     # what headers does this file include, along with the implied headers
494b4f
     deps = extract_deps(file, legal_deps)
494b4f
-    for hdr in deps.keys():
494b4f
+    for hdr in list(deps.keys()):
494b4f
       deps.update(h_deps.get(hdr, {}))
494b4f
 
494b4f
-    vals = deps.values()
494b4f
+    vals = list(deps.values())
494b4f
     vals.sort()
494b4f
-    f.write('%s: %s .make.dirs %s\n' % (obj, file, string.join(vals)))
494b4f
+    f.write('%s: %s .make.dirs %s\n' % (obj, file, " ".join(vals)))
494b4f
 
494b4f
   objects.sort()
494b4f
 
494b4f
@@ -210,7 +213,7 @@
494b4f
     for hdr, deps in header_deps.items():
494b4f
       # print hdr, deps
494b4f
       start = len(deps)
494b4f
-      for dep in deps.keys():
494b4f
+      for dep in list(deps.keys()):
494b4f
         deps.update(header_deps.get(dep, {}))
494b4f
       if len(deps) != start:
494b4f
         altered = 1
494b4f
@@ -220,7 +223,7 @@
494b4f
 
494b4f
 def get_files(patterns):
494b4f
   files = [ ]
494b4f
-  for pat in string.split(patterns):
494b4f
+  for pat in patterns.split():
494b4f
     files.extend(map(clean_path, glob.glob(pat)))
494b4f
   files.sort()
494b4f
   return files
494b4f
--- apr-1.6.3/build/buildcheck.sh
494b4f
+++ apr-1.6.3/build/buildcheck.sh
494b4f
@@ -4,7 +4,7 @@
494b4f
 res=0
494b4f
 
494b4f
 # any python
494b4f
-python=`build/PrintPath python`
494b4f
+python=${PYTHON-`build/PrintPath python3 python2 python`}
494b4f
 if test -z "$python"; then
494b4f
   echo "buildconf: python not found."
494b4f
   echo "           You need python installed"
494b4f
@@ -11,7 +11,7 @@
494b4f
   echo "           to build APR from SVN."
494b4f
   res=1
494b4f
 else
494b4f
-  py_version=`python -c 'import sys; print sys.version' 2>&1|sed 's/ .*//;q'`
494b4f
+  py_version=`$python -c 'import sys; print(sys.version)' 2>&1|sed 's/ .*//;q'`
494b4f
   echo "buildconf: python version $py_version (ok)"
494b4f
 fi
494b4f