linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] scripts/tags.sh: fix direct execution of scripts/tags.sh
@ 2019-04-29  4:06 Masahiro Yamada
  2019-05-01 12:39 ` Masahiro Yamada
  0 siblings, 1 reply; 2+ messages in thread
From: Masahiro Yamada @ 2019-04-29  4:06 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Sergey Senozhatsky, Masahiro Yamada, linux-kernel

I thought this script was run via "make tags" etc. but some people
run it directly.

Prior to commit a9a49c2ad9b9 ("kbuild: use $(srctree) instead of
KBUILD_SRC to check out-of-tree build"), in such a usecase, "tree"
was set empty since KBUILD_SRC is undefined. Now, "tree" is set to
"${srctree}/", which is evaluated to "/".

Fix it by taking into account the case where "srctree" is unset.

Link: https://lkml.org/lkml/2019/4/19/501
Fixes: a9a49c2ad9b9 ("kbuild: use $(srctree) instead of KBUILD_SRC to check out-of-tree build")
Reported-by: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 scripts/tags.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/tags.sh b/scripts/tags.sh
index 6a55180..70e14c6 100755
--- a/scripts/tags.sh
+++ b/scripts/tags.sh
@@ -19,7 +19,7 @@ ignore="$ignore ( -name *.mod.c ) -prune -o"
 # Do not use full path if we do not use O=.. builds
 # Use make O=. {tags|cscope}
 # to force full paths for a non-O= build
-if [ "${srctree}" = "." ]; then
+if [ "${srctree}" = "." -o -z "${srctree}" ]; then
 	tree=
 else
 	tree=${srctree}/
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] scripts/tags.sh: fix direct execution of scripts/tags.sh
  2019-04-29  4:06 [PATCH] scripts/tags.sh: fix direct execution of scripts/tags.sh Masahiro Yamada
@ 2019-05-01 12:39 ` Masahiro Yamada
  0 siblings, 0 replies; 2+ messages in thread
From: Masahiro Yamada @ 2019-05-01 12:39 UTC (permalink / raw)
  To: Linux Kbuild mailing list; +Cc: Sergey Senozhatsky, Linux Kernel Mailing List

On Mon, Apr 29, 2019 at 1:07 PM Masahiro Yamada
<yamada.masahiro@socionext.com> wrote:
>
> I thought this script was run via "make tags" etc. but some people
> run it directly.
>
> Prior to commit a9a49c2ad9b9 ("kbuild: use $(srctree) instead of
> KBUILD_SRC to check out-of-tree build"), in such a usecase, "tree"
> was set empty since KBUILD_SRC is undefined. Now, "tree" is set to
> "${srctree}/", which is evaluated to "/".
>
> Fix it by taking into account the case where "srctree" is unset.
>
> Link: https://lkml.org/lkml/2019/4/19/501
> Fixes: a9a49c2ad9b9 ("kbuild: use $(srctree) instead of KBUILD_SRC to check out-of-tree build")
> Reported-by: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> ---

Applied to linux-kbuild.


>
>  scripts/tags.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/scripts/tags.sh b/scripts/tags.sh
> index 6a55180..70e14c6 100755
> --- a/scripts/tags.sh
> +++ b/scripts/tags.sh
> @@ -19,7 +19,7 @@ ignore="$ignore ( -name *.mod.c ) -prune -o"
>  # Do not use full path if we do not use O=.. builds
>  # Use make O=. {tags|cscope}
>  # to force full paths for a non-O= build
> -if [ "${srctree}" = "." ]; then
> +if [ "${srctree}" = "." -o -z "${srctree}" ]; then
>         tree=
>  else
>         tree=${srctree}/
> --
> 2.7.4
>


-- 
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-05-01 12:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-29  4:06 [PATCH] scripts/tags.sh: fix direct execution of scripts/tags.sh Masahiro Yamada
2019-05-01 12:39 ` Masahiro Yamada

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).