ice-wm / icewm

IceWM releases only, see Wiki
https://github.com/ice-wm/icewm/releases
Other
289 stars 16 forks source link

icewm.html cannot be build on NetBSD and other systems #168

Closed cheusov closed 4 months ago

cheusov commented 4 months ago

On NetBSD /bin/sh -c 'test existing-file -nt file-that-does-no-exit' exits with $?=1 That's why icewm.html is not built on NetBSD. The following patch solves the problem: Note: NetBSD's /bin/sh is not the only shell working this way. Another popular example is zsh.

--- doc/Makefile.am.orig 2024-05-20 14:51:49.000000000 +0000 +++ doc/Makefile.am @@ -13,13 +13,9 @@ adoc_input = $(srcdir)/icewm.adoc

 $(html_documentation):
        $(AM_V_GEN)if test -x "`which $(MARKDOWN) 2>/dev/null`"; then \
-               if test $(mark_input) -nt $(html_documentation); then \
-                       $(MARKDOWN) $(mark_input) >$@; \
-               fi; \
+               $(MARKDOWN) $(mark_input) >$@; \
        elif test -x "`which $(ASCIIDOC) 2>/dev/null`"; then \
-               if test $(adoc_input) -nt $(html_documentation); then \
-                       $(ASCIIDOC) $(ASCIIDOC_BACKEND) -o $@ $(adoc_input); \
-               fi; \
+               $(ASCIIDOC) $(ASCIIDOC_BACKEND) -o $@ $(adoc_input); \
        else \
                echo "Please install markdown or asciidoctor." >&2; \
                exit 1; \
gijsbers commented 4 months ago

That patch is not acceptable, because it bluntly removes the intended functionality. Maybe you can rework it to also test if the target file doesn't exists.

cheusov commented 4 months ago

That patch is not acceptable, because it bluntly removes the intended functionality. Maybe you can rework it to also test if the target file doesn't exists.

Of course, I can adapt it. My goal was to demonstrate where the problem is.

cheusov commented 4 months ago

That patch is not acceptable, because it bluntly removes the intended functionality. Maybe you can rework it to also test if the target file doesn't exists.

--- doc/Makefile.am.orig    2024-05-20 14:51:49.000000000 +0000
+++ doc/Makefile.am
@@ -13,11 +13,11 @@ adoc_input = $(srcdir)/icewm.adoc

 $(html_documentation):
    $(AM_V_GEN)if test -x "`which $(MARKDOWN) 2>/dev/null`"; then \
-       if test $(mark_input) -nt $(html_documentation); then \
+       if test $(mark_input) -nt $(html_documentation) || ! test -f $(html_documentation); then \
            $(MARKDOWN) $(mark_input) >$@; \
        fi; \
    elif test -x "`which $(ASCIIDOC) 2>/dev/null`"; then \
-       if test $(adoc_input) -nt $(html_documentation); then \
+       if test $(adoc_input) -nt $(html_documentation) || ! test -f $(html_documentation); then \
            $(ASCIIDOC) $(ASCIIDOC_BACKEND) -o $@ $(adoc_input); \
        fi; \
    else \
gijsbers commented 4 months ago

Does the NetBSD test support the -o operator? Then it could be more succinctly written as -o ! -f ...?

cheusov commented 4 months ago

Does the NetBSD test support the -o operator? Then it could be more succinctly written as -o ! -f ...?

Yes. On NetBSD you can use "-o ! -f ..." as well. It is up to you which variant you choose.