Skip to content

Commit

Permalink
Merge pull request #269 from cgwalters/install-systemd-auto
Browse files Browse the repository at this point in the history
Two systemd unit fixes
  • Loading branch information
vrothberg committed Jan 18, 2024
2 parents 769fc7e + ffa527b commit 4550e51
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 13 deletions.
15 changes: 8 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +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

# These are not installed by default; one recommendation is to put them in a separate
# sub-package or sub-component.
install-systemd-auto:
# 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
Expand Down
8 changes: 7 additions & 1 deletion manpages-md-extra/bootc-fetch-apply-updates.service.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
% bootc-fetch-apply-updates(5)

# NAME

bootc-fetch-apply-updates.service
Expand All @@ -17,11 +19,15 @@ 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:

- `bootc upgrade --check`
- `bootc upgrade`
- `bootc upgrade --apply`

# SEE ALSO

**bootc(1)**
1 change: 1 addition & 0 deletions xtask/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
11 changes: 6 additions & 5 deletions xtask/src/xtask.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 --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(())
}
Expand Down

0 comments on commit 4550e51

Please sign in to comment.