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