用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/canonical/snapd --skill bump-snapd-apparmor命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | bump-snapd-apparmor |
| description | Update the AppArmor userspace bundled in the snapd snap and keep related version checks/tests in sync. |
| metadata | {"project":"snapd","task-type":"packaging"} |
Use this when updating the AppArmor userspace source used by the apparmor part in build-aux/snap/snapcraft.yaml.
Historical AppArmor bump commits update these files together:
build-aux/snap/snapcraft.yamlcmd/configure.acsandbox/apparmor/apparmor_test.gobuild-aux/snap/local/apparmor/af_names.hPatch-level bumps usually only change version strings and the source checksum. Major/minor bumps may also need build-package or build-flag changes.
Check recent bump commits:
git log --oneline -- build-aux/snap/snapcraft.yaml
git show --stat <recent-apparmor-bump-commit>
git show --unified=20 <recent-apparmor-bump-commit> -- build-aux/snap/snapcraft.yaml cmd/configure.ac sandbox/apparmor/apparmor_test.go build-aux/snap/local/apparmor/af_names.h
Verify the upstream tag exists:
git ls-remote --tags https://gitlab.com/apparmor/apparmor.git 'refs/tags/v<version>'
Download the exact upstream archive and calculate its checksum:
curl -fL -o /tmp/opencode/apparmor-v<version>.tar.gz \
https://gitlab.com/apparmor/apparmor/-/archive/v<version>/apparmor-v<version>.tar.gz
sha256sum /tmp/opencode/apparmor-v<version>.tar.gz
Update build-aux/snap/snapcraft.yaml:
source URLsource-checksumUpdate cmd/configure.ac for snapcraft builds:
PKG_CHECK_MODULES([APPARMOR], [libapparmor = <version>], [
Update the fake parser version in sandbox/apparmor/apparmor_test.go.
Regenerate or compare af_names.h from the new archive:
rm -rf /tmp/opencode/apparmor-v<version>
tar -xf /tmp/opencode/apparmor-v<version>.tar.gz -C /tmp/opencode
make -C /tmp/opencode/apparmor-v<version>/parser af_names.h
diff -u /tmp/opencode/apparmor-v<version>/parser/af_names.h \
build-aux/snap/local/apparmor/af_names.h
The vendored file has a local provenance header prepended. If generated content is otherwise identical, update only the version in that header.
Run focused checks:
go test ./sandbox/apparmor
git diff --check
Search for stale version references in relevant file types:
rg '<old-version>' -g'*.ac' -g'*.go' -g'*.h' -g'*.yaml' -g'*.yml'
For full packaging validation, build the snap without --clean-snapd-only, because the AppArmor part changed:
./tests/build-test-snapd-snap
Do not use --clean-snapd-only for AppArmor bumps; that preserves non-snapd parts and can miss the changed AppArmor part.