Re: patch realpath on aix

2019-09-22 Thread Paul Smith
On Fri, 2019-09-13 at 21:42 -0400, Dmitry Goncharov via Bug reports and
discussion for GNU make wrote:
> 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.

I changed the realpath function to remove trailing slashes on AIX.

There's a gnulib version of realpath that will fix this; after this
release I will probably make an attempt to pull in more of the gnulib
portability versions at which time this extra code can go.


___
Bug-make mailing list
Bug-make@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-make


Re: patch realpath on aix

2019-09-16 Thread Paul Smith
On Fri, 2019-09-13 at 21:42 -0400, Dmitry Goncharov via Bug reports and
discussion for GNU make wrote:
> 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.

This one didn't make it into the current RC but I'll address it before
4.3.


___
Bug-make mailing list
Bug-make@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-make


patch realpath on aix

2019-09-13 Thread Dmitry Goncharov via Bug reports and discussion for GNU make
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

___
Bug-make mailing list
Bug-make@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-make