scons_gd/scons/test/Install/fixture/SConstruct-multi
2022-10-15 16:06:26 +02:00

25 lines
597 B
Plaintext

# first run creates a src file, makes it read-only, and installs.
# second run updates src, Install should successfully replace
# the previous install (read-only attr on Windows might fail it)
import os
import pathlib
import stat
destdir = pathlib.Path("bin")
destdir.mkdir(exist_ok=True)
srcfile = pathlib.Path("hello")
try:
srcfile.chmod(stat.S_IREAD | stat.S_IWRITE)
except OSError:
pass
with srcfile.open(mode="w") as f:
print("Hello from ", os.getpid(), file=f)
srcfile.chmod(stat.S_IREAD)
DefaultEnvironment(tools=[])
env = Environment(tools=[])
env.Install('bin', 'hello')