diff mbox series

[iproute2,1/2] man: add ip-netns(8) as generation target

Message ID 20200407174306.145032-1-briannorris@chromium.org
State Accepted
Delegated to: stephen hemminger
Headers show
Series [iproute2,1/2] man: add ip-netns(8) as generation target | expand

Commit Message

Brian Norris April 7, 2020, 5:43 p.m. UTC
Prepare for adding new variable substitutions. Unify the sed rules while
we're at it, since there's no need to write this out 4 times.

Signed-off-by: Brian Norris <briannorris@chromium.org>
---
 man/man8/.gitignore                    |  1 +
 man/man8/Makefile                      | 10 ++--------
 man/man8/{ip-netns.8 => ip-netns.8.in} |  0
 3 files changed, 3 insertions(+), 8 deletions(-)
 rename man/man8/{ip-netns.8 => ip-netns.8.in} (100%)

Comments

Stephen Hemminger April 7, 2020, 6:24 p.m. UTC | #1
On Tue,  7 Apr 2020 10:43:05 -0700
Brian Norris <briannorris@chromium.org> wrote:

> Prepare for adding new variable substitutions. Unify the sed rules while
> we're at it, since there's no need to write this out 4 times.
> 
> Signed-off-by: Brian Norris <briannorris@chromium.org>

Why is this needed?
Brian Norris April 7, 2020, 6:38 p.m. UTC | #2
On Tue, Apr 7, 2020 at 11:24 AM Stephen Hemminger
<stephen@networkplumber.org> wrote:
>
> On Tue,  7 Apr 2020 10:43:05 -0700
> Brian Norris <briannorris@chromium.org> wrote:
>
> > Prepare for adding new variable substitutions. Unify the sed rules while
> > we're at it, since there's no need to write this out 4 times.
> >
> > Signed-off-by: Brian Norris <briannorris@chromium.org>
>
> Why is this needed?

For patch 1: it's only for the sake of patch 2.
If you're implying that patch 2 doesn't describe the "why?" well
enough: I'll try again:

> man: replace $(NETNS_ETC_DIR) and $(NETNS_RUN_DIR) in ip-netns(8)
>
> These can be configured to different paths. Reflect that in the
> generated documentation.

This is needed because Chrom{ium,e} OS patches iproute2 to use /run
directly instead of /var/run [1]. We also build the man pages, so we'd
like the man-pages to match.

Incidentally, we were already manually patching this out (in both
source and man-page) before this upstream patch existed:
e2f5ceccdab5 Allow to configure /var/run/netns directory
It would be nice if we could just use the Makefile variable instead.

I can resubmit if you'd like a more verbose description in the patch
submission itself.

Brian

[1] Longer answer: because the latter traverses a symlink on a
read/write partition, whereas the former is a direct-mounted tmpfs. We
can provide better guarantees for programs that avoid symlinks like
this.
Stephen Hemminger April 20, 2020, 4:40 p.m. UTC | #3
On Tue,  7 Apr 2020 10:43:05 -0700
Brian Norris <briannorris@chromium.org> wrote:

> Prepare for adding new variable substitutions. Unify the sed rules while
> we're at it, since there's no need to write this out 4 times.
> 
> Signed-off-by: Brian Norris <briannorris@chromium.org>
> ---
>  man/man8/.gitignore                    |  1 +
>  man/man8/Makefile                      | 10 ++--------
>  man/man8/{ip-netns.8 => ip-netns.8.in} |  0
>  3 files changed, 3 insertions(+), 8 deletions(-)
>  rename man/man8/{ip-netns.8 => ip-netns.8.in} (100%)

Sure, applied both patches
diff mbox series

Patch

diff --git a/man/man8/.gitignore b/man/man8/.gitignore
index 0c3d15047fde..7b08e9114455 100644
--- a/man/man8/.gitignore
+++ b/man/man8/.gitignore
@@ -1,4 +1,5 @@ 
 # these pages are built
 ip-address.8
 ip-link.8
+ip-netns.8
 ip-route.8
diff --git a/man/man8/Makefile b/man/man8/Makefile
index 0269e17406b7..9c62312396a2 100644
--- a/man/man8/Makefile
+++ b/man/man8/Makefile
@@ -1,17 +1,11 @@ 
 # SPDX-License-Identifier: GPL-2.0
-TARGETS = ip-address.8 ip-link.8 ip-route.8
+TARGETS = ip-address.8 ip-link.8 ip-netns.8 ip-route.8
 
 MAN8PAGES = $(TARGETS) $(filter-out $(TARGETS),$(wildcard *.8))
 
 all: $(TARGETS)
 
-ip-address.8: ip-address.8.in
-	sed "s|@SYSCONFDIR@|$(CONFDIR)|g" $< > $@
-
-ip-link.8: ip-link.8.in
-	sed "s|@SYSCONFDIR@|$(CONFDIR)|g" $< > $@
-
-ip-route.8: ip-route.8.in
+%: %.in
 	sed "s|@SYSCONFDIR@|$(CONFDIR)|g" $< > $@
 
 distclean: clean
diff --git a/man/man8/ip-netns.8 b/man/man8/ip-netns.8.in
similarity index 100%
rename from man/man8/ip-netns.8
rename to man/man8/ip-netns.8.in