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