Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Two systemd unit fixes #269

Merged
merged 3 commits into from
Jan 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading