diff options
Diffstat (limited to 'SConstruct')
-rw-r--r-- | SConstruct | 46 |
1 files changed, 24 insertions, 22 deletions
@@ -3,6 +3,8 @@ # # See the README.rst file for an overview of how SCons is built and tested. +from __future__ import print_function + copyright_years = '2001 - 2016' # This gets inserted into the man pages to reflect the month of release. @@ -53,7 +55,7 @@ def is_windows(): return True else: return False - + SConsignFile() # @@ -73,7 +75,7 @@ def whereis(file): st = os.stat(f_ext) except: continue - if stat.S_IMODE(st[stat.ST_MODE]) & 0111: + if stat.S_IMODE(st[stat.ST_MODE]) & 0o111: return f_ext return None @@ -161,7 +163,7 @@ import distutils.command no_winpack_templates = not os.path.exists(os.path.join(os.path.split(distutils.command.__file__)[0],'wininst-9.0.exe')) skip_win_packages = ARGUMENTS.get('SKIP_WIN_PACKAGES',False) or no_winpack_templates if skip_win_packages: - print "Skipping the build of Windows packages..." + print("Skipping the build of Windows packages...") python_ver = sys.version[0:3] @@ -324,7 +326,7 @@ try: import zipfile def zipit(env, target, source): - print "Zipping %s:" % str(target[0]) + print("Zipping %s:" % str(target[0])) def visit(arg, dirname, names): for name in names: path = os.path.join(dirname, name) @@ -339,7 +341,7 @@ try: zf.close() def unzipit(env, target, source): - print "Unzipping %s:" % str(source[0]) + print("Unzipping %s:" % str(source[0])) zf = zipfile.ZipFile(str(source[0]), 'r') for name in zf.namelist(): dest = os.path.join(env['UNPACK_ZIP_DIR'], name) @@ -348,7 +350,7 @@ try: os.makedirs(dir) except: pass - print dest,name + print(dest,name) # if the file exists, then delete it before writing # to it so that we don't end up trying to write to a symlink: if os.path.isfile(dest) or os.path.islink(dest): @@ -417,7 +419,7 @@ def soelim(target, source, env): def soscan(node, env, path): c = node.get_text_contents() - return re.compile(r"^[\.']so\s+(\S+)", re.M).findall(c) + return re.compile(br"^[\.']so\s+(\S+)", re.M).findall(c) soelimbuilder = Builder(action = Action(soelim), source_scanner = Scanner(soscan)) @@ -559,7 +561,7 @@ else: i = install_egg_info(dist) i.finalize_options() import os.path - print os.path.split(i.outputs[0])[1] + print(os.path.split(i.outputs[0])[1]) """ % version try: @@ -732,7 +734,7 @@ for p in [ scons ]: platform_zip = os.path.join(build, 'dist', "%s.%s.zip" % (pkg_version, platform)) - + # # Update the environment with the relevant information @@ -854,11 +856,11 @@ for p in [ scons ]: for target in distutils_targets: dist_target = env.Install('$DISTDIR', target) - AddPostAction(dist_target, Chmod(dist_target, 0644)) + AddPostAction(dist_target, Chmod(dist_target, 0o644)) dist_distutils_targets += dist_target if not gzip: - print "gzip not found in %s; skipping .tar.gz package for %s." % (os.environ['PATH'], pkg) + print("gzip not found in %s; skipping .tar.gz package for %s." % (os.environ['PATH'], pkg)) else: distutils_formats.append('gztar') @@ -870,8 +872,8 @@ for p in [ scons ]: dist_tar_gz = env.Install('$DISTDIR', tar_gz) dist_platform_tar_gz = env.Install('$DISTDIR', platform_tar_gz) Local(dist_tar_gz, dist_platform_tar_gz) - AddPostAction(dist_tar_gz, Chmod(dist_tar_gz, 0644)) - AddPostAction(dist_platform_tar_gz, Chmod(dist_platform_tar_gz, 0644)) + AddPostAction(dist_tar_gz, Chmod(dist_tar_gz, 0o644)) + AddPostAction(dist_platform_tar_gz, Chmod(dist_platform_tar_gz, 0o644)) # # Unpack the tar.gz archive created by the distutils into @@ -933,7 +935,7 @@ for p in [ scons ]: env.Command(digest, tar_gz, Digestify) if not zipit: - print "zip not found; skipping .zip package for %s." % pkg + print("zip not found; skipping .zip package for %s." % pkg) else: distutils_formats.append('zip') @@ -945,8 +947,8 @@ for p in [ scons ]: dist_zip = env.Install('$DISTDIR', zip) dist_platform_zip = env.Install('$DISTDIR', platform_zip) Local(dist_zip, dist_platform_zip) - AddPostAction(dist_zip, Chmod(dist_zip, 0644)) - AddPostAction(dist_platform_zip, Chmod(dist_platform_zip, 0644)) + AddPostAction(dist_zip, Chmod(dist_zip, 0o644)) + AddPostAction(dist_platform_zip, Chmod(dist_platform_zip, 0o644)) # # Unpack the zip archive created by the distutils into @@ -1033,8 +1035,8 @@ for p in [ scons ]: dist_noarch_rpm = env.Install('$DISTDIR', noarch_rpm) dist_src_rpm = env.Install('$DISTDIR', src_rpm) Local(dist_noarch_rpm, dist_src_rpm) - AddPostAction(dist_noarch_rpm, Chmod(dist_noarch_rpm, 0644)) - AddPostAction(dist_src_rpm, Chmod(dist_src_rpm, 0644)) + AddPostAction(dist_noarch_rpm, Chmod(dist_noarch_rpm, 0o644)) + AddPostAction(dist_src_rpm, Chmod(dist_src_rpm, 0o644)) dfiles = [os.path.join(test_rpm_dir, 'usr', x) for x in dst_files] env.Command(dfiles, @@ -1047,7 +1049,7 @@ for p in [ scons ]: # The built deb is called just x.y.z, not x.y.z.final.0 so strip those off: deb_version = '.'.join(version.split('.')[0:3]) deb = os.path.join(build_dir, 'dist', "%s_%s_all.deb" % (pkg, deb_version)) - # print "Building deb into %s (version=%s)"%(deb, deb_version) + # print("Building deb into %s (version=%s)"%(deb, deb_version)) for d in p['debian_deps']: b = env.SCons_revision(os.path.join(build, d), d) env.Depends(deb, b) @@ -1107,8 +1109,8 @@ for p in [ scons ]: dist_local_tar_gz = os.path.join("$DISTDIR/%s.tar.gz" % s_l_v) dist_local_zip = os.path.join("$DISTDIR/%s.zip" % s_l_v) - AddPostAction(dist_local_tar_gz, Chmod(dist_local_tar_gz, 0644)) - AddPostAction(dist_local_zip, Chmod(dist_local_zip, 0644)) + AddPostAction(dist_local_tar_gz, Chmod(dist_local_tar_gz, 0o644)) + AddPostAction(dist_local_zip, Chmod(dist_local_zip, 0o644)) commands = [ Delete(build_dir_local), @@ -1218,7 +1220,7 @@ if hg_status_lines: slines = [l for l in hg_status_lines if l[0] in 'ACM'] sfiles = [l.split()[-1] for l in slines] else: - print "Not building in a Mercurial tree; skipping building src package." + print("Not building in a Mercurial tree; skipping building src package.") if sfiles: remove_patterns = [ |