pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/mk/misc show-all: use separator for long rows of backs...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/e13ad87939cb
branches:  trunk
changeset: 438936:e13ad87939cb
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Sat Sep 12 21:00:10 2020 +0000

description:
show-all: use separator for long rows of backslashes

I had been confused by the printf commands since some of them used '\n'
and some used '\\\n', which seemed as if there were some quoting issue
that would make it necessary to double the backslashes.

This assumption was wrong though.  The printf commands for the
single-valued variables use the normal '\n', while the lines for the
multi-valued variables end with a real backslash in the output, to
mimick the continuation lines in makefiles.

As a hint that the '\\\n' means backslash + newline, add single quotes
between the two characters.

diffstat:

 mk/misc/show.mk |  10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diffs (31 lines):

diff -r ffc32894f155 -r e13ad87939cb mk/misc/show.mk
--- a/mk/misc/show.mk   Sat Sep 12 20:48:13 2020 +0000
+++ b/mk/misc/show.mk   Sat Sep 12 21:00:10 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: show.mk,v 1.24 2020/09/12 20:48:13 rillig Exp $
+# $NetBSD: show.mk,v 1.25 2020/09/12 21:00:10 rillig Exp $
 #
 # This file contains some targets that print information gathered from
 # variables. They do not modify any variables.
@@ -181,8 +181,8 @@
        elif value=${${v}:U:M*:Q} && test "x$$value" = "x"; then        \
          printf '  %-6s%-${w}s # empty\n' ${_LABEL.${c}} ${v:Q}=;      \
        else                                                            \
-         printf '  %-6s%-${w}s \\\n' ${_LABEL.${c}} ${v:Q}=;           \
-         printf '        %-${w}s %s \\\n' ${${v}:O:C,\\\$,\$\$\$\$,g:@x@'' ${x:Q}@}; \
+         printf '  %-6s%-${w}s \\''\n' ${_LABEL.${c}} ${v:Q}=;         \
+         printf '        %-${w}s %s \\''\n' ${${v}:O:C,\\\$,\$\$\$\$,g:@x@'' ${x:Q}@}; \
          printf '        %-${w}s # end of %s (sorted)\n' '' ${v:Q};    \
        fi
 
@@ -195,8 +195,8 @@
        elif value=${${v}:U:M*:Q} && test "x$$value" = "x"; then        \
          printf '  %-6s%-${w}s # empty\n' ${_LABEL.${c}} ${v:Q}=;      \
        else                                                            \
-         printf '  %-6s%-${w}s \\\n' ${_LABEL.${c}} ${v:Q}=;           \
-         printf '        %-${w}s %s \\\n' ${${v}:C,\\\$,\$\$\$\$,g:@x@'' ${x:Q}@}; \
+         printf '  %-6s%-${w}s \\''\n' ${_LABEL.${c}} ${v:Q}=;         \
+         printf '        %-${w}s %s \\''\n' ${${v}:C,\\\$,\$\$\$\$,g:@x@'' ${x:Q}@}; \
          printf '        %-${w}s # end of %s\n' '' ${v:Q};             \
        fi
 



Home | Main Index | Thread Index | Old Index