mirror of
https://github.com/Relintai/scons_gd.git
synced 2025-02-18 17:14:38 +01:00
25 lines
597 B
Plaintext
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')
|