[Scons-dev] Contribution to SCons development.

Shreedhar Manek shreedharmanek at gmail.com
Sat Dec 6 09:37:17 EST 2014


>
> 256 is octal 0400, so it looks like it's only getting the S_IRUSR part.
>> And that's because I steered you wrong; these are bitmasks, so you have to
>> use bitwise OR:  S_IRUSR | S_IRGRP | S_IROTH
>>
>
This was it. Thanks!

Should I replace *all *integers with their counterpart string? Or only
select ones?

Replacing the first 0777 with S_IRWXU | S_IRWXG | S_IRWXO in

test.write('SConstruct', """
Execute(Chmod('f1', 0666))
Execute(Chmod(('f1-File'), 0666))
Execute(Chmod('d2', S_IRWXU | S_IRWXG | S_IRWXO))
Execute(Chmod(Dir('d2-Dir'), 0777))
def cat(env, source, target):
    target = str(target[0])
    f = open(target, "wb")
    for src in source:
        f.write(open(str(src), "rb").read())
    f.close()
Cat = Action(cat)
env = Environment()
env.Command('bar.out', 'bar.in', [Cat,
                                  Chmod("f3", 0666),
                                  Chmod("d4", 0777)])
env = Environment(FILE = 'f5')
env.Command('f6.out', 'f6.in', [Chmod('$FILE', 0666), Cat])
env.Command('f7.out', 'f7.in', [Cat,
                                Chmod('Chmod-$SOURCE', 0666),
                                Chmod('${TARGET}-Chmod', 0666)])

# Make sure Chmod works with a list of arguments
env = Environment(FILE = 'f9')
env.Command('f8.out', 'f8.in', [Chmod(['$FILE', File('f10')], 0666), Cat])
Execute(Chmod(['d11', Dir('d12')], 0777))
""")

gives the following error,

STDERR
=========================================================================
NameError: name 'S_IRWXU' is not defined:
  File "/tmp/testcmd.23013.se_zJm/SConstruct", line 4:
    Execute(Chmod('d2', S_IRWXU | S_IRWXG | S_IRWXO))

FAILED test of /home/shrox/scons/src/script/scons.py
at line 598 of /home/shrox/scons/QMTest/TestCommon.py (_complete)
from line 701 of /home/shrox/scons/QMTest/TestCommon.py (run)
from line 390 of /home/shrox/scons/QMTest/TestSCons.py (run)
from line 123 of test/Chmod.py



-- 
Shreedhar Manek
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist2.pair.net/pipermail/scons-dev/attachments/20141206/405ff18f/attachment.html>


More information about the Scons-dev mailing list