summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRussel Winder <russel@winder.org.uk>2016-03-01 08:45:42 (GMT)
committerRussel Winder <russel@winder.org.uk>2016-03-01 08:45:42 (GMT)
commit14924bcc1713c5bd7dcf4db5b420204407048889 (patch)
treea679d247d04daf78f0a58ee0bb05afa04488704a
parent193c96046004369ba13fb9b4fc0e992513cc8f78 (diff)
parent3791dc82915d61f0b9eee4738fc090c8a23b162c (diff)
downloadSCons-14924bcc1713c5bd7dcf4db5b420204407048889.zip
SCons-14924bcc1713c5bd7dcf4db5b420204407048889.tar.gz
SCons-14924bcc1713c5bd7dcf4db5b420204407048889.tar.bz2
Resolved conflicting merge.
-rw-r--r--doc/generated/examples/caching_ex-random_1.xml4
-rw-r--r--doc/generated/examples/tasks_ex1_1.xml2
-rw-r--r--doc/generated/examples/troubleshoot_Dump_1.xml2
-rw-r--r--doc/generated/examples/troubleshoot_Dump_2.xml2
-rw-r--r--doc/generated/examples/troubleshoot_explain1_3.xml2
-rw-r--r--doc/generated/examples/troubleshoot_stacktrace_2.xml4
-rw-r--r--doc/generated/tools.gen12
-rw-r--r--doc/generated/tools.mod4
-rw-r--r--doc/generated/variables.gen40
-rw-r--r--doc/man/scons.xml9
-rw-r--r--doc/user/scanners.xml2
-rw-r--r--src/CHANGES.txt16
-rw-r--r--src/engine/SCons/Defaults.py64
-rw-r--r--src/engine/SCons/Platform/PlatformTests.py20
-rw-r--r--src/engine/SCons/Platform/posix.py6
-rw-r--r--test/Chmod.py47
16 files changed, 191 insertions, 45 deletions
diff --git a/doc/generated/examples/caching_ex-random_1.xml b/doc/generated/examples/caching_ex-random_1.xml
index 6a0337b..cb14259 100644
--- a/doc/generated/examples/caching_ex-random_1.xml
+++ b/doc/generated/examples/caching_ex-random_1.xml
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<screen xmlns="http://www.scons.org/dbxsd/v1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.scons.org/dbxsd/v1.0 http://www.scons.org/dbxsd/v1.0/scons.xsd">% <userinput>scons -Q</userinput>
-cc -o f2.o -c f2.c
cc -o f1.o -c f1.c
+cc -o f4.o -c f4.c
cc -o f5.o -c f5.c
cc -o f3.o -c f3.c
-cc -o f4.o -c f4.c
+cc -o f2.o -c f2.c
cc -o prog f1.o f2.o f3.o f4.o f5.o
</screen>
diff --git a/doc/generated/examples/tasks_ex1_1.xml b/doc/generated/examples/tasks_ex1_1.xml
index 5760a45..4885fde 100644
--- a/doc/generated/examples/tasks_ex1_1.xml
+++ b/doc/generated/examples/tasks_ex1_1.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<screen xmlns="http://www.scons.org/dbxsd/v1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.scons.org/dbxsd/v1.0 http://www.scons.org/dbxsd/v1.0/scons.xsd">% <userinput>scons -Q</userinput>
+cat &lt; test.bar &gt; test.h
cc -o app main.cpp
cat &lt; foo.bar2 &gt; foo.cpp
cc -o app2 main2.cpp foo.cpp
-cat &lt; test.bar &gt; test.h
</screen>
diff --git a/doc/generated/examples/troubleshoot_Dump_1.xml b/doc/generated/examples/troubleshoot_Dump_1.xml
index bf141a0..99d1399 100644
--- a/doc/generated/examples/troubleshoot_Dump_1.xml
+++ b/doc/generated/examples/troubleshoot_Dump_1.xml
@@ -47,7 +47,7 @@ scons: Reading SConscript files ...
'PROGSUFFIX': '',
'PSPAWN': &lt;function piped_env_spawn at 0x700000&amp;gt;,
'RDirs': &lt;SCons.Defaults.Variable_Method_Caller object at 0x700000&amp;gt;,
- 'SCANNERS': [],
+ 'SCANNERS': [&lt;SCons.Scanner.Base object at 0x700000&amp;gt;],
'SHELL': 'sh',
'SHLIBPREFIX': '$LIBPREFIX',
'SHLIBSUFFIX': '.so',
diff --git a/doc/generated/examples/troubleshoot_Dump_2.xml b/doc/generated/examples/troubleshoot_Dump_2.xml
index 0ae8fe1..a621422 100644
--- a/doc/generated/examples/troubleshoot_Dump_2.xml
+++ b/doc/generated/examples/troubleshoot_Dump_2.xml
@@ -71,7 +71,7 @@ scons: Reading SConscript files ...
'RCFLAGS': [],
'RCSUFFIXES': ['.rc', '.rc2'],
'RDirs': &lt;SCons.Defaults.Variable_Method_Caller object at 0x700000&amp;gt;,
- 'SCANNERS': [],
+ 'SCANNERS': [&lt;SCons.Scanner.Base object at 0x700000&amp;gt;],
'SHCC': '$CC',
'SHCCCOM': &lt;SCons.Action.FunctionAction object at 0x700000&amp;gt;,
'SHCCFLAGS': ['$CCFLAGS'],
diff --git a/doc/generated/examples/troubleshoot_explain1_3.xml b/doc/generated/examples/troubleshoot_explain1_3.xml
index 3d8592d..7e495ea 100644
--- a/doc/generated/examples/troubleshoot_explain1_3.xml
+++ b/doc/generated/examples/troubleshoot_explain1_3.xml
@@ -3,5 +3,5 @@
cp file.in file.oout
scons: warning: Cannot find target file.out after building
-File "/scons/as_scons/bootstrap/src/script/scons.py", line 199, in &lt;module&gt;
+File "/home/ghost/projects/scons/bootstrap/src/script/scons.py", line 199, in &lt;module&gt;
</screen>
diff --git a/doc/generated/examples/troubleshoot_stacktrace_2.xml b/doc/generated/examples/troubleshoot_stacktrace_2.xml
index add59ff..1de0dcf 100644
--- a/doc/generated/examples/troubleshoot_stacktrace_2.xml
+++ b/doc/generated/examples/troubleshoot_stacktrace_2.xml
@@ -4,10 +4,10 @@ scons: *** [prog.o] Source `prog.c' not found, needed by target `prog.o'.
scons: internal stack trace:
File "bootstrap/src/engine/SCons/Job.py", line 199, in start
task.prepare()
- File "bootstrap/src/engine/SCons/Script/Main.py", line 173, in prepare
+ File "bootstrap/src/engine/SCons/Script/Main.py", line 164, in prepare
return SCons.Taskmaster.OutOfDateTask.prepare(self)
File "bootstrap/src/engine/SCons/Taskmaster.py", line 191, in prepare
executor.prepare()
- File "bootstrap/src/engine/SCons/Executor.py", line 430, in prepare
+ File "bootstrap/src/engine/SCons/Executor.py", line 427, in prepare
raise SCons.Errors.StopError(msg % (s, self.batches[0].targets[0]))
</screen>
diff --git a/doc/generated/tools.gen b/doc/generated/tools.gen
index ba12966..fcb7587 100644
--- a/doc/generated/tools.gen
+++ b/doc/generated/tools.gen
@@ -780,19 +780,19 @@ Sets construction variables for the
</para>
<para>Sets: &cv-link-AS;, &cv-link-ASCOM;, &cv-link-ASFLAGS;, &cv-link-ASPPCOM;, &cv-link-ASPPFLAGS;.</para><para>Uses: &cv-link-ASCOMSTR;, &cv-link-ASPPCOMSTR;.</para></listitem>
</varlistentry>
- <varlistentry id="t-Packaging">
- <term>Packaging</term>
+ <varlistentry id="t-packaging">
+ <term>packaging</term>
<listitem>
<para xmlns="http://www.scons.org/dbxsd/v1.0">
-Sets construction variables for the <function xmlns="http://www.scons.org/dbxsd/v1.0">Package</function> Builder.
+A framework for building binary and source packages.
</para>
</listitem>
</varlistentry>
- <varlistentry id="t-packaging">
- <term>packaging</term>
+ <varlistentry id="t-Packaging">
+ <term>Packaging</term>
<listitem>
<para xmlns="http://www.scons.org/dbxsd/v1.0">
-A framework for building binary and source packages.
+Sets construction variables for the <function xmlns="http://www.scons.org/dbxsd/v1.0">Package</function> Builder.
</para>
</listitem>
</varlistentry>
diff --git a/doc/generated/tools.mod b/doc/generated/tools.mod
index 2ee2270..1191e6a 100644
--- a/doc/generated/tools.mod
+++ b/doc/generated/tools.mod
@@ -78,8 +78,8 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT.
<!ENTITY t-mwcc "<literal xmlns='http://www.scons.org/dbxsd/v1.0'>mwcc</literal>">
<!ENTITY t-mwld "<literal xmlns='http://www.scons.org/dbxsd/v1.0'>mwld</literal>">
<!ENTITY t-nasm "<literal xmlns='http://www.scons.org/dbxsd/v1.0'>nasm</literal>">
-<!ENTITY t-Packaging "<literal xmlns='http://www.scons.org/dbxsd/v1.0'>Packaging</literal>">
<!ENTITY t-packaging "<literal xmlns='http://www.scons.org/dbxsd/v1.0'>packaging</literal>">
+<!ENTITY t-Packaging "<literal xmlns='http://www.scons.org/dbxsd/v1.0'>Packaging</literal>">
<!ENTITY t-pdf "<literal xmlns='http://www.scons.org/dbxsd/v1.0'>pdf</literal>">
<!ENTITY t-pdflatex "<literal xmlns='http://www.scons.org/dbxsd/v1.0'>pdflatex</literal>">
<!ENTITY t-pdftex "<literal xmlns='http://www.scons.org/dbxsd/v1.0'>pdftex</literal>">
@@ -189,8 +189,8 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT.
<!ENTITY t-link-mwcc "<link linkend='t-mwcc' xmlns='http://www.scons.org/dbxsd/v1.0'><literal>mwcc</literal></link>">
<!ENTITY t-link-mwld "<link linkend='t-mwld' xmlns='http://www.scons.org/dbxsd/v1.0'><literal>mwld</literal></link>">
<!ENTITY t-link-nasm "<link linkend='t-nasm' xmlns='http://www.scons.org/dbxsd/v1.0'><literal>nasm</literal></link>">
-<!ENTITY t-link-Packaging "<link linkend='t-Packaging' xmlns='http://www.scons.org/dbxsd/v1.0'><literal>Packaging</literal></link>">
<!ENTITY t-link-packaging "<link linkend='t-packaging' xmlns='http://www.scons.org/dbxsd/v1.0'><literal>packaging</literal></link>">
+<!ENTITY t-link-Packaging "<link linkend='t-Packaging' xmlns='http://www.scons.org/dbxsd/v1.0'><literal>Packaging</literal></link>">
<!ENTITY t-link-pdf "<link linkend='t-pdf' xmlns='http://www.scons.org/dbxsd/v1.0'><literal>pdf</literal></link>">
<!ENTITY t-link-pdflatex "<link linkend='t-pdflatex' xmlns='http://www.scons.org/dbxsd/v1.0'><literal>pdflatex</literal></link>">
<!ENTITY t-link-pdftex "<link linkend='t-pdftex' xmlns='http://www.scons.org/dbxsd/v1.0'><literal>pdftex</literal></link>">
diff --git a/doc/generated/variables.gen b/doc/generated/variables.gen
index b377102..b64eb5a 100644
--- a/doc/generated/variables.gen
+++ b/doc/generated/variables.gen
@@ -2838,15 +2838,6 @@ is <quote><literal>-dNOPAUSE -dBATCH -sDEVICE=pdfwrite</literal></quote>
<term>HOST_ARCH</term>
<listitem>
<para xmlns="http://www.scons.org/dbxsd/v1.0">
- The name of the host hardware architecture used to create the Environment.
- If a platform is specified when creating the Environment, then
- that Platform's logic will handle setting this value.
- This value is immutable, and should not be changed by the user after
- the Environment is initialized.
- Currently only set for Win32.
-</para>
-
-<para xmlns="http://www.scons.org/dbxsd/v1.0">
Sets the host architecture for Visual Studio compiler. If not set,
default to the detected host architecture: note that this may depend
on the python you are using.
@@ -2862,7 +2853,16 @@ Valid values are the same as for <envar xmlns="http://www.scons.org/dbxsd/v1.0">
This is currently only used on Windows, but in the future it will be
used on other OSes as well.
</para>
-</listitem>
+
+<para xmlns="http://www.scons.org/dbxsd/v1.0">
+ The name of the host hardware architecture used to create the Environment.
+ If a platform is specified when creating the Environment, then
+ that Platform's logic will handle setting this value.
+ This value is immutable, and should not be changed by the user after
+ the Environment is initialized.
+ Currently only set for Win32.
+</para>
+ </listitem>
</varlistentry>
<varlistentry id="cv-HOST_OS">
<term>HOST_OS</term>
@@ -3104,7 +3104,7 @@ The command line used to call the Java archive tool.
<para xmlns="http://www.scons.org/dbxsd/v1.0">
The string displayed when the Java archive tool
is called
-If this is not set, then <envar xmlns="http://www.scons.org/dbxsd/v1.0">$JARCOM</envar> (the command line) is displayed.
+If this is not set, then <link xmlns="http://www.scons.org/dbxsd/v1.0" linkend="cv-JARCOM"><envar>$JARCOM</envar></link> (the command line) is displayed.
</para>
<example_commands xmlns="http://www.scons.org/dbxsd/v1.0">
@@ -3114,7 +3114,7 @@ env = Environment(JARCOMSTR = "JARchiving $SOURCES into $TARGET")
<para xmlns="http://www.scons.org/dbxsd/v1.0">
The string displayed when the Java archive tool
is called
-If this is not set, then <link xmlns="http://www.scons.org/dbxsd/v1.0" linkend="cv-JARCOM"><envar>$JARCOM</envar></link> (the command line) is displayed.
+If this is not set, then <envar xmlns="http://www.scons.org/dbxsd/v1.0">$JARCOM</envar> (the command line) is displayed.
</para>
<example_commands xmlns="http://www.scons.org/dbxsd/v1.0">
@@ -7038,13 +7038,6 @@ that may not be set or used in a construction environment.
<term>TARGET_ARCH</term>
<listitem>
<para xmlns="http://www.scons.org/dbxsd/v1.0">
- The name of the target hardware architecture for the compiled objects
- created by this Environment.
- This defaults to the value of HOST_ARCH, and the user can override it.
- Currently only set for Win32.
-</para>
-
-<para xmlns="http://www.scons.org/dbxsd/v1.0">
Sets the target architecture for Visual Studio compiler (i.e. the arch
of the binaries generated by the compiler). If not set, default to
<envar xmlns="http://www.scons.org/dbxsd/v1.0">$HOST_ARCH</envar>, or, if that is unset, to the architecture of the
@@ -7069,7 +7062,14 @@ and <literal>ia64</literal> (Itanium).
For example, if you want to compile 64-bit binaries, you would set
<literal>TARGET_ARCH='x86_64'</literal> in your SCons environment.
</para>
-</listitem>
+
+<para xmlns="http://www.scons.org/dbxsd/v1.0">
+ The name of the target hardware architecture for the compiled objects
+ created by this Environment.
+ This defaults to the value of HOST_ARCH, and the user can override it.
+ Currently only set for Win32.
+</para>
+ </listitem>
</varlistentry>
<varlistentry id="cv-TARGET_OS">
<term>TARGET_OS</term>
diff --git a/doc/man/scons.xml b/doc/man/scons.xml
index 5c832c2..c72178e 100644
--- a/doc/man/scons.xml
+++ b/doc/man/scons.xml
@@ -5630,7 +5630,8 @@ env.Command('foo.out', 'foo.in',
changes the permissions on the specified
<emphasis>dest</emphasis>
file or directory to the specified
-<emphasis>mode</emphasis>.
+<emphasis>mode</emphasis>
+which can be octal or string, similar to the bash command.
Examples:</para>
<literallayout class="monospaced">
@@ -5639,6 +5640,12 @@ Execute(Chmod('file', 0755))
env.Command('foo.out', 'foo.in',
[Copy('$TARGET', '$SOURCE'),
Chmod('$TARGET', 0755)])
+
+Execute(Chmod('file', "ugo+w"))
+
+env.Command('foo.out', 'foo.in',
+ [Copy('$TARGET', '$SOURCE'),
+ Chmod('$TARGET', "ugo+w")])
</literallayout>
</listitem>
diff --git a/doc/user/scanners.xml b/doc/user/scanners.xml
index 14733db..1506254 100644
--- a/doc/user/scanners.xml
+++ b/doc/user/scanners.xml
@@ -395,7 +395,7 @@ cat
<file name="SConstruct" printme="1">
kscan = Scanner(function = kfile_scan,
skeys = ['.k'],
- path=FindPathDirs('KPATH'))
+ path_function = FindPathDirs('KPATH'))
</file>
</scons_example>
diff --git a/src/CHANGES.txt b/src/CHANGES.txt
index 93bf387..7e1e9fe 100644
--- a/src/CHANGES.txt
+++ b/src/CHANGES.txt
@@ -16,8 +16,20 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER
From William Blevins:
- Added support for cross-language dependency scanning;
SCons now respects scanner keys for implicit dependencies.
+ - Notes for SCons users with heterogeneous systems.
+ - May find new (previously missed) dependencies.
+ - May cause rebuild after upgrade due to dependency changes.
+ - May find new dependency errors (EG. cycles).
+ - Discovered in some of the SCons QT tests.
- Resolved missing cross-language dependencies for
SWIG bindings (fixes #2264).
+ - Corrected typo in User Guide for Scanner keyword. (PR #2959)
+ - Install builder interacts with scanner found in SCANNERS differently.
+ - Previous: Install builder recursively scanned implicit dependencies
+ for scanners from SCANNER, but not for built-in (default) scanners.
+ - Current: Install builder will not scan for implicit dependencies via
+ either scanner source. This optimizes some Install builder behavior
+ and brings orthogonality to Install builder scanning behavior.
From William Deegan:
- Add better messaging when two environments have
@@ -25,11 +37,15 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER
- Fix issue only with MSVC and Always build where targets
marked AlwaysBuild wouldn't make it into CHANGED_SOURCES
and thus yield an empty compile command line. (Bug #2622)
+ - Fix posix platform escaping logic to properly handle paths
+ with parens in them "()". (Bug #2225)
From Jakub Pola:
- Intel Compiler 2016 (Linux/Mac) update for tool directories.
+ From Adarsh Sanjeev:
+ - Fix for issue #2494: Added string support for Chmod function.
RELEASE 2.4.1 - Mon, 07 Nov 2015 10:37:21 -0700
diff --git a/src/engine/SCons/Defaults.py b/src/engine/SCons/Defaults.py
index e26a5c0..b198a24 100644
--- a/src/engine/SCons/Defaults.py
+++ b/src/engine/SCons/Defaults.py
@@ -169,15 +169,73 @@ def get_paths_str(dest):
else:
return '"' + str(dest) + '"'
+permission_dic = {
+ 'u':{
+ 'r':stat.S_IRUSR,
+ 'w':stat.S_IWUSR,
+ 'x':stat.S_IXUSR
+ },
+ 'g':{
+ 'r':stat.S_IRGRP,
+ 'w':stat.S_IWGRP,
+ 'x':stat.S_IXGRP
+ },
+ 'o':{
+ 'r':stat.S_IROTH,
+ 'w':stat.S_IWOTH,
+ 'x':stat.S_IXOTH
+ }
+}
+
def chmod_func(dest, mode):
+ import SCons.Util
+ from string import digits
SCons.Node.FS.invalidate_node_memos(dest)
if not SCons.Util.is_List(dest):
dest = [dest]
- for element in dest:
- os.chmod(str(element), mode)
+ if SCons.Util.is_String(mode) and not 0 in [i in digits for i in mode]:
+ mode = int(mode, 8)
+ if not SCons.Util.is_String(mode):
+ for element in dest:
+ os.chmod(str(element), mode)
+ else:
+ mode = str(mode)
+ for operation in mode.split(","):
+ if "=" in operation:
+ operator = "="
+ elif "+" in operation:
+ operator = "+"
+ elif "-" in operation:
+ operator = "-"
+ else:
+ raise SyntaxError("Could not find +, - or =")
+ operation_list = operation.split(operator)
+ if len(operation_list) is not 2:
+ raise SyntaxError("More than one operator found")
+ user = operation_list[0].strip().replace("a", "ugo")
+ permission = operation_list[1].strip()
+ new_perm = 0
+ for u in user:
+ for p in permission:
+ try:
+ new_perm = new_perm | permission_dic[u][p]
+ except KeyError:
+ raise SyntaxError("Unrecognized user or permission format")
+ for element in dest:
+ curr_perm = os.stat(str(element)).st_mode
+ if operator == "=":
+ os.chmod(str(element), new_perm)
+ elif operator == "+":
+ os.chmod(str(element), curr_perm | new_perm)
+ elif operator == "-":
+ os.chmod(str(element), curr_perm & ~new_perm)
def chmod_strfunc(dest, mode):
- return 'Chmod(%s, 0%o)' % (get_paths_str(dest), mode)
+ import SCons.Util
+ if not SCons.Util.is_String(mode):
+ return 'Chmod(%s, 0%o)' % (get_paths_str(dest), mode)
+ else:
+ return 'Chmod(%s, "%s")' % (get_paths_str(dest), str(mode))
Chmod = ActionFactory(chmod_func, chmod_strfunc)
diff --git a/src/engine/SCons/Platform/PlatformTests.py b/src/engine/SCons/Platform/PlatformTests.py
index 38ea55a..3432e94 100644
--- a/src/engine/SCons/Platform/PlatformTests.py
+++ b/src/engine/SCons/Platform/PlatformTests.py
@@ -187,11 +187,29 @@ class TempFileMungeTestCase(unittest.TestCase):
assert cmd != defined_cmd, cmd
assert cmd == getattr(target[0].attributes, 'tempfile_cmdlist', None)
+class PlatformEscapeTestCase(unittest.TestCase):
+ def test_posix_escape(self):
+ """ Check that paths with parens are escaped properly
+ """
+ import SCons.Platform.posix
+
+ test_string = "/my (really) great code/main.cpp"
+ output = SCons.Platform.posix.escape(test_string)
+
+ # We expect the escape function to wrap the string
+ # in quotes, but not escape any internal characters
+ # in the test_string. (Parens doesn't require shell
+ # escaping if their quoted)
+ assert output[1:-1] == test_string
+
+
if __name__ == "__main__":
suite = unittest.TestSuite()
tclasses = [ PlatformTestCase,
- TempFileMungeTestCase ]
+ TempFileMungeTestCase,
+ PlatformEscapeTestCase,
+ ]
for tclass in tclasses:
names = unittest.getTestCaseNames(tclass, 'test_')
suite.addTests(list(map(tclass, names)))
diff --git a/src/engine/SCons/Platform/posix.py b/src/engine/SCons/Platform/posix.py
index 7e69a7c..190a2a6 100644
--- a/src/engine/SCons/Platform/posix.py
+++ b/src/engine/SCons/Platform/posix.py
@@ -48,16 +48,18 @@ exitvalmap = {
}
def escape(arg):
- "escape shell special characters"
+ "escape shell special characters"
slash = '\\'
- special = '"$()'
+ special = '"$'
arg = arg.replace(slash, slash+slash)
for c in special:
arg = arg.replace(c, slash+c)
+ # print "ESCAPE RESULT: %s"%arg
return '"' + arg + '"'
+
def exec_subprocess(l, env):
proc = subprocess.Popen(l, env = env, close_fds = True)
return proc.wait()
diff --git a/test/Chmod.py b/test/Chmod.py
index 8b5fbe0..e5bb85f 100644
--- a/test/Chmod.py
+++ b/test/Chmod.py
@@ -64,6 +64,11 @@ env.Command('f7.out', 'f7.in', [Cat,
env = Environment(FILE = 'f9')
env.Command('f8.out', 'f8.in', [Chmod(['$FILE', File('f10')], 0666), Cat])
Execute(Chmod(['d11', Dir('d12')], 0777))
+Execute(Chmod('f13', "a=r"))
+Execute(Chmod('f14', "ogu+w"))
+Execute(Chmod('f15', "ug=rw, go+ rw"))
+Execute(Chmod('d16', "0777"))
+Execute(Chmod(['d17', 'd18'], "ogu = rwx"))
""")
test.write('f1', "f1\n")
@@ -86,6 +91,12 @@ test.write('f9', "f9\n")
test.write('f10', "f10\n")
test.subdir('d11')
test.subdir('d12')
+test.write('f13', "f13\n")
+test.write('f14', "f14\n")
+test.write('f15', "f15\n")
+test.subdir('d16')
+test.subdir('d17')
+test.subdir('d18')
os.chmod(test.workpath('f1'), 0o444)
os.chmod(test.workpath('f1-File'), 0o444)
@@ -100,13 +111,23 @@ os.chmod(test.workpath('f9'), 0o444)
os.chmod(test.workpath('f10'), 0o444)
os.chmod(test.workpath('d11'), 0o555)
os.chmod(test.workpath('d12'), 0o555)
-
+os.chmod(test.workpath('f13'), 0o444)
+os.chmod(test.workpath('f14'), 0o444)
+os.chmod(test.workpath('f15'), 0o444)
+os.chmod(test.workpath('d16'), 0o555)
+os.chmod(test.workpath('d17'), 0o555)
+os.chmod(test.workpath('d18'), 0o555)
expect = test.wrap_stdout(read_str = """\
Chmod("f1", 0666)
Chmod("f1-File", 0666)
Chmod("d2", 0777)
Chmod("d2-Dir", 0777)
Chmod(["d11", "d12"], 0777)
+Chmod("f13", "a=r")
+Chmod("f14", "ogu+w")
+Chmod("f15", "ug=rw, go+ rw")
+Chmod("d16", "0777")
+Chmod(["d17", "d18"], "ogu = rwx")
""",
build_str = """\
cat(["bar.out"], ["bar.in"])
@@ -152,6 +173,18 @@ s = stat.S_IMODE(os.stat(test.workpath('d11'))[stat.ST_MODE])
test.fail_test(s != 0o555)
s = stat.S_IMODE(os.stat(test.workpath('d12'))[stat.ST_MODE])
test.fail_test(s != 0o555)
+s = stat.S_IMODE(os.stat(test.workpath('f13'))[stat.ST_MODE])
+test.fail_test(s != 0o444)
+s = stat.S_IMODE(os.stat(test.workpath('f14'))[stat.ST_MODE])
+test.fail_test(s != 0o444)
+s = stat.S_IMODE(os.stat(test.workpath('f15'))[stat.ST_MODE])
+test.fail_test(s != 0o444)
+s = stat.S_IMODE(os.stat(test.workpath('d16'))[stat.ST_MODE])
+test.fail_test(s != 0o555)
+s = stat.S_IMODE(os.stat(test.workpath('d17'))[stat.ST_MODE])
+test.fail_test(s != 0o555)
+s = stat.S_IMODE(os.stat(test.workpath('d18'))[stat.ST_MODE])
+test.fail_test(s != 0o555)
test.run()
@@ -185,6 +218,18 @@ s = stat.S_IMODE(os.stat(test.workpath('d11'))[stat.ST_MODE])
test.fail_test(s != 0o777)
s = stat.S_IMODE(os.stat(test.workpath('d12'))[stat.ST_MODE])
test.fail_test(s != 0o777)
+s = stat.S_IMODE(os.stat(test.workpath('f13'))[stat.ST_MODE])
+test.fail_test(s != 0o444)
+s = stat.S_IMODE(os.stat(test.workpath('f14'))[stat.ST_MODE])
+test.fail_test(s != 0o666)
+s = stat.S_IMODE(os.stat(test.workpath('f15'))[stat.ST_MODE])
+test.fail_test(s != 0o666)
+s = stat.S_IMODE(os.stat(test.workpath('d16'))[stat.ST_MODE])
+test.fail_test(s != 0o777)
+s = stat.S_IMODE(os.stat(test.workpath('d17'))[stat.ST_MODE])
+test.fail_test(s != 0o777)
+s = stat.S_IMODE(os.stat(test.workpath('d18'))[stat.ST_MODE])
+test.fail_test(s != 0o777)
test.pass_test()