Hi,
I have written an simple script based on find and file commands.
To use it, first it needs to set the exclusion pattern inside the script.
After that, you can run the script using "test" as argument to list the files that are not meant to be executable, example:
./find-non-executables-with-execution-bit.sh test
and use "execute" as argument to unset execution bit from all files that have execution bit but are not executable using "file command", example:
./find-non-executables-with-execution-bit.sh execute
Note: The exclusion pattern was needed because I have noted that some perl files are not using shebang, so the "file command" cannot detect it as executable.
Can you send me the git-hook pre-commit so I can try to modify it to make this tests automatically?
Francisco Kem Iti Saito
4linux
Em 23/03/2011 às 12:34 horas, "Tor Lillqvist" <tlillqvist@novell.com> escreveu:
> OK. I will pass something like this (with more extensions) on all source
> tree and will send patches after this:
>
> find -name "*.cxx" -o -name "*.hxx" -o -name "*.mk" -exec chmod -x '{}' \;
Thanks, but it is simpler to just send the script, once you have a good set of file extensions to handle. We can still commit the resulting change giving you credit.
(Also, much faster to use -print0 | xargs -0 chmod -x.)
--tml
Attachment:
find-non-executables-with-execution-bit.sh
Description: Binary data
Context
- Re: [Libreoffice] [PATCH] removing the executable mode from some source files · saito
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.