aboutsummaryrefslogtreecommitdiffstats
path: root/CLAUDE.md
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-05-18 20:51:25 +0200
committerDanilo M. <danix@danix.xyz>2026-05-18 20:51:25 +0200
commit2456315640a9ec33f9f61a13c44a23a69d85d931 (patch)
tree1011bb99ded70dc17ebc52778293387e58579931 /CLAUDE.md
downloadis-required-2456315640a9ec33f9f61a13c44a23a69d85d931.tar.gz
is-required-2456315640a9ec33f9f61a13c44a23a69d85d931.zip
Initial commit: is_required script and bash completion
Bash script to find SBo packages that depend on a given package, with installed/uninstalled marking and color output. Includes bash-completion for package name suggestions. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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
+```