- #
- # Run setup.py in the unpacked subdirectory to "install" everything
- # into our build/test subdirectory. The runtest.py script will set
- # PYTHONPATH so that the tests only look under build/test-{package},
- # and under etc (for the testing modules TestCmd.py, TestSCons.py,
- # and unittest.py). This makes sure that our tests pass with what
- # we really packaged, not because of something hanging around in
- # the development directory.
- #
- # We can get away with calling setup.py using a directory path
- # like this because we put a preamble in it that will chdir()
- # to the directory in which setup.py exists.
- dfiles = map(lambda x, d=test_src_arch_dir: os.path.join(d, x),
- dst_files)
- ENV = env.Dictionary('ENV')
- ENV['SCONS_LIB_DIR'] = os.path.join(unpack_dir, psv, 'src', 'engine')
- ENV['USERNAME'] = developer
- env.Copy(ENV = ENV).Command(dfiles, unpack_files, [
- "rm -rf %s" % os.path.join(unpack_dir,
- psv,
- 'build',
- 'scons',
- 'build'),
- "rm -rf %s" % test_src_arch_dir,
- "cd %s && python %s %s" % \
- (os.path.join(unpack_dir, psv),
- os.path.join('src', 'script', 'scons.py'),
- os.path.join('build', 'scons')),
- "python %s install --prefix=%s" % (os.path.join(unpack_dir,
- psv,
- 'build',
- 'scons',
- 'setup.py'),
- test_src_arch_dir
- ),
- ])
+ env.Command(src_tar_gz, b_psv_stamp,
+ "tar cz${TAR_HFLAG} -f $TARGET -C build %s" % psv)
+
+ #
+ # Unpack the archive into build/unpack/scons-{version}.
+ #
+ unpack_tar_gz_files = map(lambda x, u=unpack_tar_gz_dir, psv=psv:
+ os.path.join(u, psv, x),
+ sfiles)
+
+ #
+ # We'd like to replace the last three lines with the following:
+ #
+ # tar zxf $SOURCES -C $UNPACK_TAR_GZ_DIR
+ #
+ # but that gives heartburn to Cygwin's tar, so work around it
+ # with separate zcat-tar-rm commands.
+ env.Command(unpack_tar_gz_files, src_tar_gz, [
+ "rm -rf %s" % os.path.join(unpack_tar_gz_dir, psv),
+ "zcat $SOURCES > .temp",
+ "tar xf .temp -C $UNPACK_TAR_GZ_DIR",
+ "rm -f .temp",
+ ])
+
+ #
+ # Run setup.py in the unpacked subdirectory to "install" everything
+ # into our build/test subdirectory. The runtest.py script will set
+ # PYTHONPATH so that the tests only look under build/test-{package},
+ # and under etc (for the testing modules TestCmd.py, TestSCons.py,
+ # and unittest.py). This makes sure that our tests pass with what
+ # we really packaged, not because of something hanging around in
+ # the development directory.
+ #
+ # We can get away with calling setup.py using a directory path
+ # like this because we put a preamble in it that will chdir()
+ # to the directory in which setup.py exists.
+ #
+ dfiles = map(lambda x, d=test_src_tar_gz_dir: os.path.join(d, x),
+ dst_files)
+ ENV = env.Dictionary('ENV')
+ ENV['SCONS_LIB_DIR'] = os.path.join(unpack_tar_gz_dir, psv, 'src', 'engine')
+ ENV['USERNAME'] = developer
+ env.Copy(ENV = ENV).Command(dfiles, unpack_tar_gz_files, [
+ "rm -rf %s" % os.path.join(unpack_tar_gz_dir,
+ psv,
+ 'build',
+ 'scons',
+ 'build'),
+ "rm -rf $TEST_SRC_TAR_GZ_DIR",
+ "cd %s && python %s %s" % \
+ (os.path.join(unpack_tar_gz_dir, psv),
+ os.path.join('src', 'script', 'scons.py'),
+ os.path.join('build', 'scons')),
+ "python %s install --prefix=$TEST_SRC_TAR_GZ_DIR" % \
+ os.path.join(unpack_tar_gz_dir,
+ psv,
+ 'build',
+ 'scons',
+ 'setup.py'),
+ ])
+
+ if zipit:
+
+ env.Copy(PSV = psv).Command(src_zip, b_psv_stamp, zipit)
+
+ #
+ # Unpack the archive into build/unpack/scons-{version}.
+ #
+ unpack_zip_files = map(lambda x, u=unpack_zip_dir, psv=psv:
+ os.path.join(u, psv, x),
+ sfiles)
+
+ env.Command(unpack_zip_files, src_zip, unzipit)
+
+ #
+ # Run setup.py in the unpacked subdirectory to "install" everything
+ # into our build/test subdirectory. The runtest.py script will set
+ # PYTHONPATH so that the tests only look under build/test-{package},
+ # and under etc (for the testing modules TestCmd.py, TestSCons.py,
+ # and unittest.py). This makes sure that our tests pass with what
+ # we really packaged, not because of something hanging around in
+ # the development directory.
+ #
+ # We can get away with calling setup.py using a directory path
+ # like this because we put a preamble in it that will chdir()
+ # to the directory in which setup.py exists.
+ #
+ dfiles = map(lambda x, d=test_src_zip_dir: os.path.join(d, x),
+ dst_files)
+ ENV = env.Dictionary('ENV')
+ ENV['SCONS_LIB_DIR'] = os.path.join(unpack_zip_dir, psv, 'src', 'engine')
+ ENV['USERNAME'] = developer
+ env.Copy(ENV = ENV).Command(dfiles, unpack_zip_files, [
+ "rm -rf %s" % os.path.join(unpack_zip_dir,
+ psv,
+ 'build',
+ 'scons',
+ 'build'),
+ "rm -rf $TEST_SRC_ZIP_DIR",
+ "cd %s && python %s %s" % \
+ (os.path.join(unpack_zip_dir, psv),
+ os.path.join('src', 'script', 'scons.py'),
+ os.path.join('build', 'scons')),
+ "python %s install --prefix=$TEST_SRC_ZIP_DIR" % \
+ os.path.join(unpack_zip_dir,
+ psv,
+ 'build',
+ 'scons',
+ 'setup.py'),
+ ])