summaryrefslogtreecommitdiffstats
path: root/test/Install/fixture/SConstruct-multi
blob: 68736af302142847e4894bd75721d26603bfab4f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# SPDX-License-Identifier: MIT
#
# Copyright The SCons Foundation
#
# 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')