From 99a84fa3f66ebcac84a2aef7107d0bb7a68a4b17 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Wed, 17 Jan 2024 16:10:43 -0500 Subject: [PATCH 1/3] build: Install systemd units by default I was being too chicken; there's no reason not to install our systemd units by default. They're not enabled by default, but we do want to encourage their use. Signed-off-by: Colin Walters --- Makefile | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Makefile b/Makefile index 75d6888cb..afc662046 100644 --- a/Makefile +++ b/Makefile @@ -13,10 +13,6 @@ install: # a dependency on pandoc downstream if test -d man; then install -D -m 0644 -t $(DESTDIR)$(prefix)/share/man/man5 man/*.5; fi if test -d man; then install -D -m 0644 -t $(DESTDIR)$(prefix)/share/man/man8 man/*.8; fi - -# These are not installed by default; one recommendation is to put them in a separate -# sub-package or sub-component. -install-systemd-auto: install -D -m 0644 -t $(DESTDIR)/$(prefix)/lib/systemd/system systemd/*.service systemd/*.timer bin-archive: all From afb34bdcf5a03c5febab45c5887cd0d387d92ae4 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Wed, 17 Jan 2024 16:23:42 -0500 Subject: [PATCH 2/3] Fix manpage for service We need `-s` for the pandoc invocation to render this right. Signed-off-by: Colin Walters --- Makefile | 11 ++++++++--- .../bootc-fetch-apply-updates.service.md | 8 +++++++- xtask/src/xtask.rs | 2 +- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index afc662046..bf98298b2 100644 --- a/Makefile +++ b/Makefile @@ -10,9 +10,14 @@ install: install -D -m 0755 -t $(DESTDIR)$(prefix)/bin target/release/bootc install -d $(DESTDIR)$(prefix)/lib/bootc/install # Support installing pre-generated man pages shipped in source tarball, to avoid - # a dependency on pandoc downstream - if test -d man; then install -D -m 0644 -t $(DESTDIR)$(prefix)/share/man/man5 man/*.5; fi - if test -d man; then install -D -m 0644 -t $(DESTDIR)$(prefix)/share/man/man8 man/*.8; fi + # a dependency on pandoc downstream. But in local builds these end up in target/man, + # so we honor that too. + for d in man target/man; do \ + if test -d $$d; then \ + install -D -m 0644 -t $(DESTDIR)$(prefix)/share/man/man5 $$d/*.5; \ + install -D -m 0644 -t $(DESTDIR)$(prefix)/share/man/man8 $$d/*.8; \ + fi; \ + done install -D -m 0644 -t $(DESTDIR)/$(prefix)/lib/systemd/system systemd/*.service systemd/*.timer bin-archive: all diff --git a/manpages-md-extra/bootc-fetch-apply-updates.service.md b/manpages-md-extra/bootc-fetch-apply-updates.service.md index c4831c2d1..ed16ce8b9 100644 --- a/manpages-md-extra/bootc-fetch-apply-updates.service.md +++ b/manpages-md-extra/bootc-fetch-apply-updates.service.md @@ -1,3 +1,5 @@ +% bootc-fetch-apply-updates(5) + # NAME bootc-fetch-apply-updates.service @@ -17,7 +19,7 @@ project is enabled for daily updates. However, it is fully expected that different operating systems and distributions choose different defaults. -## Customizing updates +# CUSTOMIZING UPDATES Note that all three of these steps can be decoupled; they are: @@ -25,3 +27,7 @@ are: - `bootc upgrade --check` - `bootc upgrade` - `bootc upgrade --apply` + +# SEE ALSO + +**bootc(1)** \ No newline at end of file diff --git a/xtask/src/xtask.rs b/xtask/src/xtask.rs index b79043293..00bb0681b 100644 --- a/xtask/src/xtask.rs +++ b/xtask/src/xtask.rs @@ -106,7 +106,7 @@ fn manpages(sh: &Shell) -> Result<()> { .ok_or_else(|| anyhow!("Expected filename in {srcpath:?}"))?; cmd!( sh, - "pandoc --from=markdown --to=man --output=target/man/{base_filename}.5 {srcpath}" + "pandoc -s --from=markdown --to=man --output=target/man/{base_filename}.5 {srcpath}" ) .run()?; } From ffa527b440f671a4fca2f4d6dbf313bbcb0eb53b Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Wed, 17 Jan 2024 19:43:05 -0500 Subject: [PATCH 3/3] xtask: Use mandown, not pandoc I forgot that this direction of things is used when we're making a default tarball, and we didn't currently depend on pandoc there. Let's use this `mandown` crate instead which definitely does the trick. Signed-off-by: Colin Walters --- xtask/Cargo.toml | 1 + xtask/src/xtask.rs | 11 ++++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/xtask/Cargo.toml b/xtask/Cargo.toml index b7c59d2c0..7e0d66437 100644 --- a/xtask/Cargo.toml +++ b/xtask/Cargo.toml @@ -17,4 +17,5 @@ camino = "1.0" chrono = { version = "0.4.23", default_features = false, features = ["std"] } fn-error-context = "0.2.0" tempfile = "3.3" +mandown = "0.1" xshell = { version = "0.2" } diff --git a/xtask/src/xtask.rs b/xtask/src/xtask.rs index 00bb0681b..cf0126431 100644 --- a/xtask/src/xtask.rs +++ b/xtask/src/xtask.rs @@ -104,11 +104,12 @@ fn manpages(sh: &Shell) -> Result<()> { .file_stem() .and_then(|name| name.to_str()) .ok_or_else(|| anyhow!("Expected filename in {srcpath:?}"))?; - cmd!( - sh, - "pandoc -s --from=markdown --to=man --output=target/man/{base_filename}.5 {srcpath}" - ) - .run()?; + let src = + std::fs::read_to_string(&srcpath).with_context(|| format!("Reading {srcpath:?}"))?; + let section = 5; + let buf = mandown::convert(&src, base_filename, section); + let target = format!("target/man/{base_filename}.{section}"); + std::fs::write(&target, buf).with_context(|| format!("Writing {target}"))?; } Ok(()) }