aboutsummaryrefslogtreecommitdiffstats
path: root/CLAUDE.md
diff options
context:
space:
mode:
Diffstat (limited to 'CLAUDE.md')
-rw-r--r--CLAUDE.md27
1 files changed, 27 insertions, 0 deletions
diff --git a/CLAUDE.md b/CLAUDE.md
new file mode 100644
index 0000000..cb115fe
--- /dev/null
+++ b/CLAUDE.md
@@ -0,0 +1,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
+```