aboutsummaryrefslogtreecommitdiffstats
path: root/AGENTS.md
blob: 723408e485a2935bacbccfd3c848a3004718c781 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# AGENTS.md

`dist-upgrade` is a single bash script that updates a Slackware `-current`
system with `slackpkg` and verifies the initrd afterwards.

## Testing

Run all of these before calling a change done:

    bash -n dist-upgrade
    ./dist-upgrade --self-test
    shellcheck --exclude=SC2218 dist-upgrade

If `logrotate` is available, the shipped rule can be checked with:

    logrotate -d logrotate.d/dist-upgrade

SC2218 is a shellcheck 0.11.0 false positive: it flags a function called on the
left of a pipe inside another function definition (`b() { a | cat; }`), even
when `a` is defined above. Keep it excluded; do not restructure the pipeline to
silence it.

## Do not

- Do not run the script itself, or any `slackpkg` command, in this repo. It
  performs a real system upgrade and only makes sense on the user's Slackware
  box as root.
- Do not add runtime config, cache or log files. The script is self-contained
  and configured through the `INITRD` and `LOG` environment variables; the only
  config it ships is `logrotate.d/dist-upgrade`.

## Conventions

- One file, no unrequested abstractions. Standard library and Slackware's own
  tools over new dependencies.
- Anything that parses initrd contents or `mkinitrd` output gets a case in
  `--self-test`.
- License is GPLv2-only. New source files carry the copyright header.