SPS · log · files · refs · tags · releases · people · languages · GitHub · commit
a3c1291
Wire opt-in community recipe tree
Parents
Stat
DESIGN.md | 6 ++++++ PACKAGE-MAINTAINER.md | 4 ++++ README.md | 11 +++++++++++ bin/mkiso | 1 + bin/setup | 1 + examples/repos.conf | 6 +++++- lib/common.sh | 10 ++++++++++ man/mkiso.1 | 4 ++++ man/setup.1 | 4 ++++ man/sps.conf.5 | 15 +++++++++++++++ man/src.1 | 7 +++++++ tests/test_common.sh | 18 ++++++++++++++++++ tests/test_install.sh | 6 ++++++ tests/test_mkiso.sh | 5 +++++ tests/test_setup.sh | 12 +++++++++++- 15 files changed, 108 insertions(+), 2 deletions(-)
Diff
diff --git a/DESIGN.md b/DESIGN.md
index 58485b3..3532453 100644
--- a/DESIGN.md
+++ b/DESIGN.md
@@ -132,6 +132,12 @@ Repository declarations are `git NAME SOURCE [PRIORITY]` or
alias for `dir`. Git checkouts live below `$SPS_REPO_ROOT`, defaulting to
`/usr/src/sps`, while directory repositories stay at their configured paths.
+Splux enables `core` (100) and `extra` (80). `community`
+(`https://github.com/RobertFlexx/sps-community.git`, 50) is hosted with the
+same tools but is not written as an active line by `setup`, `mkiso`, or
+`install-config`. An administrator adds `git community` to opt in. Official
+names win when both trees supply the same package.
+
`src update` clones an absent Git checkout, fetches an existing clean checkout,
and fast-forwards only when its configured upstream is a descendant of `HEAD`.
It leaves detached heads, branches without an `origin` upstream, and locally
diff --git a/PACKAGE-MAINTAINER.md b/PACKAGE-MAINTAINER.md
index 8495cd3..9012140 100644
--- a/PACKAGE-MAINTAINER.md
+++ b/PACKAGE-MAINTAINER.md
@@ -104,6 +104,10 @@ Declare everything needed in a controlled build root. A successful build on a
maintainer workstation is insufficient if undeclared host tools or libraries
made it succeed.
+New packages that are not ready for extra belong in
+[sps-community](https://github.com/RobertFlexx/sps-community). That tree is
+opt-in. Do not reuse a `name` from core or extra.
+
## Architecture and release
Omit `arch` for compiled packages. It then defaults to the exact configured
diff --git a/README.md b/README.md
index 0ba0d29..fad4f5d 100644
--- a/README.md
+++ b/README.md
@@ -122,6 +122,17 @@ Put this in `/etc/sps/repos.conf`:
dir local /usr/local/src/sps-local 200
git core https://github.com/RobertFlexx/sps-core.git 100
git extra https://github.com/RobertFlexx/sps-extra.git 80
+
+# Community recipes are not enabled by default.
+# git community https://github.com/RobertFlexx/sps-community.git 50
+```
+
+`setup`, `mkiso`, and `install-config` enable core and extra only. A third
+collection, [sps-community](https://github.com/RobertFlexx/sps-community), is
+opt-in. Uncomment that git line, or add it yourself:
+
+```text
+git community https://github.com/RobertFlexx/sps-community.git 50
```
Then synchronize Git checkouts and build the local index:
diff --git a/bin/mkiso b/bin/mkiso
index b379a5b..297fa54 100755
--- a/bin/mkiso
+++ b/bin/mkiso
@@ -1608,6 +1608,7 @@ git core https://github.com/RobertFlexx/sps-core.git 100
git extra https://github.com/RobertFlexx/sps-extra.git 80
EOF
fi
+sps_print_community_repos_hint >>"$mkiso_repos"
# dialog and glibc/libtinfo on every image, including --no-seed.
if [ -f "$mkiso_libdir/live-bins" ]; then
diff --git a/bin/setup b/bin/setup
index 27758ec..707ed6b 100755
--- a/bin/setup
+++ b/bin/setup
@@ -1966,6 +1966,7 @@ setup_write_repos_conf()
else
printf 'git extra https://github.com/RobertFlexx/sps-extra.git 80\n'
fi
+ sps_print_community_repos_hint
} >"$setup_root/etc/sps/repos.conf" ||
setup_fail "$SPS_EX_PERMISSION" "cannot write target repos.conf"
}
diff --git a/examples/repos.conf b/examples/repos.conf
index 7f8817b..0f36803 100644
--- a/examples/repos.conf
+++ b/examples/repos.conf
@@ -3,8 +3,12 @@
# dir NAME ABSOLUTE_PATH [PRIORITY]
#
# Official repositories are cloned below repo_root/NAME. Local trees are
-# indexed in place. Higher priority wins.
+# indexed in place. Higher priority wins. setup and mkiso write active
+# core and extra lines. Community is a comment only until you add it.
#
# dir local /usr/local/src/sps-local 200
# git core https://github.com/RobertFlexx/sps-core.git 100
# git extra https://github.com/RobertFlexx/sps-extra.git 80
+#
+# Community recipes are not enabled by default.
+# git community https://github.com/RobertFlexx/sps-community.git 50
diff --git a/lib/common.sh b/lib/common.sh
index 3d1336a..c95b985 100644
--- a/lib/common.sh
+++ b/lib/common.sh
@@ -638,6 +638,16 @@ sps_print_default_conf()
'preserve etc'
}
+# Comment-only. setup, mkiso, and install-config never write an active
+# community line. Administrators add `git community` themselves.
+sps_print_community_repos_hint()
+{
+ printf '%s\n' \
+ '' \
+ '# Community recipes are not enabled by default.' \
+ '# git community https://github.com/RobertFlexx/sps-community.git 50'
+}
+
sps_load_config()
{
[ "${SPS_ROOT+x}" = x ] && sps_env_root=1 || sps_env_root=0
diff --git a/man/mkiso.1 b/man/mkiso.1
index 4b1f4a8..4ad53dc 100644
--- a/man/mkiso.1
+++ b/man/mkiso.1
@@ -98,6 +98,10 @@ Copy recipe trees to
.I /usr/src/sps/core
and
.IR /usr/src/sps/extra .
+Those collections are enabled in the live
+.BR repos.conf .
+Community recipes are a comment in that file and are never copied
+into the image.
.TP
.B --with-rust
.TP
diff --git a/man/setup.1 b/man/setup.1
index 2ef7ce1..e914a05 100644
--- a/man/setup.1
+++ b/man/setup.1
@@ -163,6 +163,10 @@ set.
Individual packages in addition to the profile and sets. The extras
screen only lists names that exist as recipes in sps-core or sps-extra.
Unpackaged names are refused after the repository index is built.
+Community recipes are not in that catalog until
+.B git community
+is added to
+.IR /etc/sps/repos.conf .
.TP
.B --ssh yes|no
Enable the OpenSSH set.
diff --git a/man/sps.conf.5 b/man/sps.conf.5
index 4c6760a..bacf2c3 100644
--- a/man/sps.conf.5
+++ b/man/sps.conf.5
@@ -166,7 +166,22 @@ preserve etc
dir local /usr/local/src/sps-local 200
git core https://github.com/RobertFlexx/sps-core.git 100
git extra https://github.com/RobertFlexx/sps-extra.git 80
+
+# Community recipes are not enabled by default.
+# git community https://github.com/RobertFlexx/sps-community.git 50
.fi
+.PP
+Splux enables core (priority 100) and extra (80) from
+.B setup
+and
+.BR mkiso .
+Community recipes live at
+.I https://github.com/RobertFlexx/sps-community.git
+with priority 50. They are never an active line in a generated
+.BR repos.conf .
+Add
+.B git community
+yourself to opt in.
.SH SEE ALSO
.BR src (1),
.BR sget (1),
diff --git a/man/src.1 b/man/src.1
index eb946d3..dce3369 100644
--- a/man/src.1
+++ b/man/src.1
@@ -16,6 +16,13 @@ src status [--raw]
manages source repository metadata. It never builds or installs packages.
It synchronizes configured Git repositories conservatively and indexes those
checkouts together with configured local directory repositories.
+Splux writes core and extra into
+.B repos.conf
+by default. Community recipes
+.RI ( https://github.com/RobertFlexx/sps-community.git ,
+priority 50) are documented as a comment only; add
+.B git community
+to enable them.
.SH COMMANDS
.TP
.B update
diff --git a/tests/test_common.sh b/tests/test_common.sh
index d9a49ce..247ff86 100755
--- a/tests/test_common.sh
+++ b/tests/test_common.sh
@@ -102,3 +102,21 @@ sps_is_live_critical_path usr/bin/sh
! sps_is_live_critical_path usr/bin/openssl
printf '%s\n' 'usr-merge and live helper tests passed'
+
+sps_print_community_repos_hint >"$tmp/community-hint"
+grep -qx '# Community recipes are not enabled by default.' \
+ "$tmp/community-hint" || {
+ printf '%s\n' 'community hint missing explanation' >&2
+ exit 1
+}
+grep -qx '# git community https://github.com/RobertFlexx/sps-community.git 50' \
+ "$tmp/community-hint" || {
+ printf '%s\n' 'community hint missing commented git line' >&2
+ exit 1
+}
+if grep -E '^[[:space:]]*git community ' "$tmp/community-hint" >/dev/null
+then
+ printf '%s\n' 'community hint must not be an active git line' >&2
+ exit 1
+fi
+printf '%s\n' 'community repository hint tests passed'
diff --git a/tests/test_install.sh b/tests/test_install.sh
index d3cf153..8a70358 100755
--- a/tests/test_install.sh
+++ b/tests/test_install.sh
@@ -39,6 +39,12 @@ for required in \
do
[ -f "$required" ] || fail "installed file is missing: $required"
done
+grep -F 'sps-community.git' "$image/etc/sps/repos.conf" >/dev/null ||
+ fail 'install-config repos.conf must document opt-in community'
+if grep -E '^[[:space:]]*git community ' "$image/etc/sps/repos.conf" >/dev/null
+then
+ fail 'install-config must not enable community'
+fi
cp "$project_dir/examples/sps.conf" "$root/etc/sps/sps.conf"
printf 'repo examples %s 100\n' "$project_dir/examples" >"$root/etc/sps/repos.conf"
diff --git a/tests/test_mkiso.sh b/tests/test_mkiso.sh
index 313fa29..2c97960 100755
--- a/tests/test_mkiso.sh
+++ b/tests/test_mkiso.sh
@@ -67,6 +67,11 @@ if [ -f "$layout/sbin/init" ]; then
fi
fi
[ -f "$layout/etc/sps/repos.conf" ] || fail 'repos.conf missing'
+if grep -E '^[[:space:]]*git community ' "$layout/etc/sps/repos.conf" >/dev/null; then
+ fail 'live ISO must not enable community'
+fi
+grep -F 'sps-community.git' "$layout/etc/sps/repos.conf" >/dev/null ||
+ fail 'live ISO repos.conf must document opt-in community'
if [ -x "$layout/bin/busybox" ] && [ -L "$layout/bin/mkdir" ]; then
target=$(readlink "$layout/bin/mkdir")
case $target in
diff --git a/tests/test_setup.sh b/tests/test_setup.sh
index 21a58c3..8845c33 100755
--- a/tests/test_setup.sh
+++ b/tests/test_setup.sh
@@ -231,9 +231,14 @@ grep -qx 'dir core /usr/src/sps/core 100' "$root_seed/etc/sps/repos.conf" ||
fail 'installed repos.conf must use /usr/src/sps paths'
grep -qx 'dir extra /usr/src/sps/extra 80' "$root_seed/etc/sps/repos.conf" ||
fail 'installed repos.conf must keep bundled extra as a dir repo'
-if grep -q 'git ' "$root_seed/etc/sps/repos.conf"; then
+if grep -E '^[[:space:]]*git ' "$root_seed/etc/sps/repos.conf" >/dev/null; then
fail 'bundled live trees must not fall back to git'
fi
+grep -F 'sps-community.git' "$root_seed/etc/sps/repos.conf" >/dev/null ||
+ fail 'installed repos.conf must document opt-in community'
+if grep -E '^[[:space:]]*git community ' "$root_seed/etc/sps/repos.conf" >/dev/null; then
+ fail 'setup must not enable community'
+fi
# No bundled trees: repos.conf is git clones, and --no-update must not
# require the network.
@@ -259,6 +264,11 @@ grep -q 'git core https://github.com/RobertFlexx/sps-core.git' \
grep -q 'git extra https://github.com/RobertFlexx/sps-extra.git' \
"$root_git/etc/sps/repos.conf" ||
fail 'empty live root should write git extra'
+if grep -E '^[[:space:]]*git community ' "$root_git/etc/sps/repos.conf" >/dev/null; then
+ fail 'git-fallback setup must not enable community'
+fi
+grep -F 'sps-community.git' "$root_git/etc/sps/repos.conf" >/dev/null ||
+ fail 'git-fallback repos.conf must document opt-in community'
# Later plans use the real profiles, not the fixture directory.
unset SPS_SETUP_DIR