bug-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

patch realpath on aix


From: Dmitry Goncharov
Subject: patch realpath on aix
Date: Fri, 13 Sep 2019 21:42:28 -0400

aix implementation of realpath returns a path with a trailing slash
given a path with 2 or more trailing slashes. This makes realpath test
fail.

$ echo 'all: ; @echo $(realpath /tmp/)' | ../i32/make -f-
/tmp
$ echo 'all: ; @echo $(realpath /tmp//)' | ../i32/make -f-
/tmp/

Since both posix and gmake manual allow this behavior this patch fixes the test
case, even though the behavior is inconsistent between os' and between /tmp/ vs
/tmp//. An alternative could be to make gmake remove the trailing slash.

regards, Dmitry

diff --git a/tests/scripts/functions/realpath b/tests/scripts/functions/realpath
index fcea515..dd7d349 100644
--- a/tests/scripts/functions/realpath
+++ b/tests/scripts/functions/realpath
@@ -13,8 +13,9 @@ ifneq ($(realpath ./),$(CURDIR))
   $(warning $(realpath ./) != $(CURDIR))
 endif

-ifneq ($(realpath .///),$(CURDIR))
-  $(warning $(realpath .///) != $(CURDIR))
+r:=$(patsubst %/,%,$(realpath .///))
+ifneq ($(r),$(CURDIR))
+  $(warning $(r) != $(CURDIR))
 endif

 .PHONY: all



reply via email to

[Prev in Thread] Current Thread [Next in Thread]