aboutsummaryrefslogtreecommitdiffstats
path: root/CLAUDE.md
blob: cb115fe6f0a9989b35f28ca4a301a089f2457a81 (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
# CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

## What this is

Two files:
- `is_required` — bash script: given a package name, searches `/var/lib/sbopkg/SBo-git/**/*.info` for entries whose `REQUIRES=` field contains that package (whole-word match), then marks each result as installed or not by checking `/var/log/packages/`
- `is_required.bash` — bash-completion script for the above

## Key design facts

**`/var/log/packages` is a symlink**`/var/lib/pkgtools/packages`. All `find` calls must use `-follow` or they return nothing.

**Package name extraction** strips the last three dash-delimited fields from filenames in `/var/log/packages` (version, arch, build tag), e.g. `ffmpeg-7.1.4-x86_64-1``ffmpeg`.

**SBo repo path** defaults to `/var/lib/sbopkg/SBo-git`; overridable via `$SBO_REPO`. Package log defaults to `/var/log/packages`; overridable via `$PKG_LOG`.

**Color output** is gated on `[[ -t 1 ]]` — auto-disabled when piped/redirected.

## Installing the completion

```bash
sudo cp is_required.bash /etc/bash_completion.d/is_required
# or for the current user (requires ~/.bash_completion.d/ sourced in ~/.bashrc):
cp is_required.bash ~/.bash_completion.d/is_required
```