[Scons-users] Chmod fun

Bill Deegan bill at baddogconsulting.com
Wed Jul 26 13:41:40 EDT 2017


Looks like a bug.
Please file at scons.tigris.org

Of course, if you'd like to fix it and send a pull request that'd be even
better..

-Bill

On Wed, Jul 26, 2017 at 10:39 AM, Mats Wichmann <mats at wichmann.us> wrote:

>
> okay, this was amusing...
>
> Execute(Chmod(ndk_bundle, 'a+x'))
>
> leads to
>
> 09:40:32 TypeError: %o format: a number is required, not str:
> from (long traceback trimmed):
> 09:40:32   File "/usr/lib/scons/SCons/Defaults.py", line 177:
> 09:40:32     return 'Chmod(%s, 0%o)' % (get_paths_str(dest), mode)
>
> scons manpage:
>
>     Returns an Action object that changes the permissions on the
> specified dest file or directory to the specified mode which can be
> octal or string, similar to the bash command. Examples:
>
>     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")])
>
> linux chmod man:
>
>        The format of a symbolic mode is  [ugoa...][[-+=][perms...]...],
> where
>        perms  is  either zero or more letters from the set rwxXst, or a
> single
>        letter from the set ugo.  Multiple symbolic modes can be  given,
> sepa‐
>        rated by commas.
>
>
> But it turns out, not 'a' for scons:
>
> permission_dic = {
>     'u':{
> ...
>     'g':{
> ...
>     },
>     'o':{
> ...
>     }
> }
>
>
> There's not a big complaint here, except that "similar to bash" doesn't
> give much detail; I guessed wrong.
>
> FWIW, http://www.scons.org/doc/latest/HTML/scons-user.html does not hint
> at the string variant of the mode at all: "The permission argument uses
> POSIX-style permission bits and should typically be expressed as an
> octal, not decimal, number".
>
> _______________________________________________
> Scons-users mailing list
> Scons-users at scons.org
> https://pairlist4.pair.net/mailman/listinfo/scons-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20170726/82edfd60/attachment.html>


More information about the Scons-users mailing list