lkml.org 
[lkml]   [2021]   [Jul]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] scripts: make some scripts executable
On Wed, Jul 28, 2021 at 12:56 AM Greg KH <gregkh@linuxfoundation.org> wrote:
>
> On Wed, Jul 28, 2021 at 12:39:24AM +0900, Masahiro Yamada wrote:
> > Set the x bit to some scripts to make them directly executable.
> >
> > Especially, scripts/checkdeclares.pl is not hooked by anyone.
> > It should be executable since it is tedious to type
> > 'perl scripts/checkdeclares.pl'.
> >
> > The original patch [1] set the x bit properly, but it was lost when
> > it was merged as commit 21917bded72c ("scripts: a new script for
> > checking duplicate struct declaration").
> >
> > [1] https://lore.kernel.org/lkml/20210401110943.1010796-1-wanjiabing@vivo.com/
> >
> > Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
> > ---
> >
> > scripts/checkdeclares.pl | 0
> > scripts/gcc-plugins/gen-random-seed.sh | 0
> > scripts/syscallnr.sh | 0
> > scripts/xen-hypercalls.sh | 0
> > 4 files changed, 0 insertions(+), 0 deletions(-)
> > mode change 100644 => 100755 scripts/checkdeclares.pl
> > mode change 100644 => 100755 scripts/gcc-plugins/gen-random-seed.sh
> > mode change 100644 => 100755 scripts/syscallnr.sh
> > mode change 100644 => 100755 scripts/xen-hypercalls.sh
>
> Please no, as other tools (i.e. patch), can not set mode bits, and some
> people still rely on patch in places.
>
> If these need to be called by other parts of the build, we should
> execute them properly, not rely on the mode settings.
>
> thanks,
>
> greg k-h


I believe tools should be executable.

If the x bit were missing in scripts/checkpatch.pl
for example, we would need to run 'perl scripts/checkpatch.pl'
instead of 'scripts/checkpatch.pl'. That is annoying.


Most of the scripts under the scripts/ directory
are already executable, and we rely on that fact.
Some of them are run directly, and I do not hear
from anyone who complains about that.




BTW, my 'patch' command on Ubuntu can handle the
x bit. Doesn't it work on your 'patch' ?


masahiro@grover:~/x-bit-test$ ls -l test.sh
-rw-rw-r-- 1 masahiro masahiro 7 Jul 28 09:50 test.sh
masahiro@grover:~/x-bit-test$ cat set-x.patch
diff --git a/test.sh b/test.sh
old mode 100644
new mode 100755
masahiro@grover:~/x-bit-test$ patch -p1 < set-x.patch
patching file test.sh
masahiro@grover:~/x-bit-test$ ls -l test.sh
-rwxr-xr-x 1 masahiro masahiro 7 Jul 28 09:51 test.sh



Even if it did not work on somebody's tools,
the diff files are provided for bug-fix
releases (for example, 5.13.x), not the entire source.

Developers (except Andrew Morton) use git
to merge patches like this, so I see no issue
on changing the mode.

--
Best Regards
Masahiro Yamada

\
 
 \ /
  Last update: 2021-07-28 03:05    [W:0.111 / U:0.120 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site