Skip to content

Commit

Permalink
scripts/tags.sh: fix direct execution of scripts/tags.sh
Browse files Browse the repository at this point in the history
I thought this script was run via "make tags" etc. but some people
run it directly.

Prior to commit a9a49c2 ("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: a9a49c2 ("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>
  • Loading branch information
Masahiro Yamada committed May 3, 2019
1 parent e46b94d commit c69ef1c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/tags.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}/
Expand Down

0 comments on commit c69ef1c

Please sign in to comment.