Skip to content

Commit 4550e51

Browse files
authored
Merge pull request #269 from cgwalters/install-systemd-auto
Two systemd unit fixes
2 parents 769fc7e + ffa527b commit 4550e51

File tree

4 files changed

+22
-13
lines changed

4 files changed

+22
-13
lines changed

Makefile

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,14 @@ install:
1010
install -D -m 0755 -t $(DESTDIR)$(prefix)/bin target/release/bootc
1111
install -d $(DESTDIR)$(prefix)/lib/bootc/install
1212
# Support installing pre-generated man pages shipped in source tarball, to avoid
13-
# a dependency on pandoc downstream
14-
if test -d man; then install -D -m 0644 -t $(DESTDIR)$(prefix)/share/man/man5 man/*.5; fi
15-
if test -d man; then install -D -m 0644 -t $(DESTDIR)$(prefix)/share/man/man8 man/*.8; fi
16-
17-
# These are not installed by default; one recommendation is to put them in a separate
18-
# sub-package or sub-component.
19-
install-systemd-auto:
13+
# a dependency on pandoc downstream. But in local builds these end up in target/man,
14+
# so we honor that too.
15+
for d in man target/man; do \
16+
if test -d $$d; then \
17+
install -D -m 0644 -t $(DESTDIR)$(prefix)/share/man/man5 $$d/*.5; \
18+
install -D -m 0644 -t $(DESTDIR)$(prefix)/share/man/man8 $$d/*.8; \
19+
fi; \
20+
done
2021
install -D -m 0644 -t $(DESTDIR)/$(prefix)/lib/systemd/system systemd/*.service systemd/*.timer
2122

2223
bin-archive: all

manpages-md-extra/bootc-fetch-apply-updates.service.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
% bootc-fetch-apply-updates(5)
2+
13
# NAME
24

35
bootc-fetch-apply-updates.service
@@ -17,11 +19,15 @@ project is enabled for daily updates.
1719
However, it is fully expected that different operating systems
1820
and distributions choose different defaults.
1921

20-
## Customizing updates
22+
# CUSTOMIZING UPDATES
2123

2224
Note that all three of these steps can be decoupled; they
2325
are:
2426

2527
- `bootc upgrade --check`
2628
- `bootc upgrade`
2729
- `bootc upgrade --apply`
30+
31+
# SEE ALSO
32+
33+
**bootc(1)**

xtask/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,5 @@ camino = "1.0"
1717
chrono = { version = "0.4.23", default_features = false, features = ["std"] }
1818
fn-error-context = "0.2.0"
1919
tempfile = "3.3"
20+
mandown = "0.1"
2021
xshell = { version = "0.2" }

xtask/src/xtask.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,12 @@ fn manpages(sh: &Shell) -> Result<()> {
104104
.file_stem()
105105
.and_then(|name| name.to_str())
106106
.ok_or_else(|| anyhow!("Expected filename in {srcpath:?}"))?;
107-
cmd!(
108-
sh,
109-
"pandoc --from=markdown --to=man --output=target/man/{base_filename}.5 {srcpath}"
110-
)
111-
.run()?;
107+
let src =
108+
std::fs::read_to_string(&srcpath).with_context(|| format!("Reading {srcpath:?}"))?;
109+
let section = 5;
110+
let buf = mandown::convert(&src, base_filename, section);
111+
let target = format!("target/man/{base_filename}.{section}");
112+
std::fs::write(&target, buf).with_context(|| format!("Writing {target}"))?;
112113
}
113114
Ok(())
114115
}

0 commit comments

Comments
 (0)