Thread (4 messages) 4 messages, 3 authors, 2021-08-31

Re: [PATCH kvm-unit-tests v2] Makefile: Don't trust PWD

From: Andrew Jones <hidden>
Date: 2021-08-31 10:31:47

On Fri, Aug 27, 2021 at 12:54:07PM +0200, Andrew Jones wrote:
quoted hunk ↗ jump to hunk
PWD comes from the environment and it's possible that it's already
set to something which isn't the full path of the current working
directory. Use the make variable $(CURDIR) instead.

Suggested-by: Thomas Huth <redacted>
Signed-off-by: Andrew Jones <redacted>
---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index f7b9f28c9319..6792b93c4e16 100644
--- a/Makefile
+++ b/Makefile
@@ -119,7 +119,7 @@ cscope: cscope_dirs = lib lib/libfdt lib/linux $(TEST_DIR) $(ARCH_LIBDIRS) lib/a
 cscope:
 	$(RM) ./cscope.*
 	find -L $(cscope_dirs) -maxdepth 1 \
-		-name '*.[chsS]' -exec realpath --relative-base=$(PWD) {} \; | sort -u > ./cscope.files
+		-name '*.[chsS]' -exec realpath --relative-base=$(CURDIR) {} \; | sort -u > ./cscope.files
 	cscope -bk
 
 .PHONY: tags
-- 
2.31.1
Applied to misc/queue and merged to master.

Thanks,
drew
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help