summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbin/shuriken6
-rw-r--r--src/lib/config.source.sh6
-rwxr-xr-xtests/cli.sh44
3 files changed, 53 insertions, 3 deletions
diff --git a/bin/shuriken b/bin/shuriken
index 30cfa56..280d8b6 100755
--- a/bin/shuriken
+++ b/bin/shuriken
@@ -4977,7 +4977,11 @@ apply_config_defaults() {
THUMB_SUBDIVIDE_PERCENT="${THUMB_SUBDIVIDE_PERCENT:-30}"
THUMB_FEATURE_PERCENT="${THUMB_FEATURE_PERCENT:-10}"
SYNC_DELETE="${SYNC_DELETE:-yes}"
- TARBALL_INCLUDE="${TARBALL_INCLUDE:-no}"
+ # Default 'yes': a tarball of the incoming dir is included in the dist unless
+ # disabled. This must match the documented default in shuriken.default.conf
+ # (TARBALL_INCLUDE=yes) -- it previously drifted to 'no' here. 'yes' is the
+ # original, authoritative default (tarball inclusion was on from the start).
+ TARBALL_INCLUDE="${TARBALL_INCLUDE:-yes}"
TARBALL_SUFFIX="${TARBALL_SUFFIX:-.tar}"
TAR_TIMEOUT="${TAR_TIMEOUT:-120}"
if ! declare -p TAR_OPTS >/dev/null 2>&1; then
diff --git a/src/lib/config.source.sh b/src/lib/config.source.sh
index 67ddade..9dd48ee 100644
--- a/src/lib/config.source.sh
+++ b/src/lib/config.source.sh
@@ -52,7 +52,11 @@ apply_config_defaults() {
THUMB_SUBDIVIDE_PERCENT="${THUMB_SUBDIVIDE_PERCENT:-30}"
THUMB_FEATURE_PERCENT="${THUMB_FEATURE_PERCENT:-10}"
SYNC_DELETE="${SYNC_DELETE:-yes}"
- TARBALL_INCLUDE="${TARBALL_INCLUDE:-no}"
+ # Default 'yes': a tarball of the incoming dir is included in the dist unless
+ # disabled. This must match the documented default in shuriken.default.conf
+ # (TARBALL_INCLUDE=yes) -- it previously drifted to 'no' here. 'yes' is the
+ # original, authoritative default (tarball inclusion was on from the start).
+ TARBALL_INCLUDE="${TARBALL_INCLUDE:-yes}"
TARBALL_SUFFIX="${TARBALL_SUFFIX:-.tar}"
TAR_TIMEOUT="${TAR_TIMEOUT:-120}"
if ! declare -p TAR_OPTS >/dev/null 2>&1; then
diff --git a/tests/cli.sh b/tests/cli.sh
index eae2f19..5d69684 100755
--- a/tests/cli.sh
+++ b/tests/cli.sh
@@ -251,6 +251,45 @@ test_init_existing_config_fails_without_overwrite() {
test::teardown
}
+# Guards against config DEFAULT DRIFT for TARBALL_INCLUDE: its documented default
+# in shuriken.default.conf (written verbatim by --init) MUST agree with the
+# fallback applied by apply_config_defaults when the key is unset. These two
+# previously disagreed ('yes' in the conf vs 'no' in apply_config_defaults); the
+# authoritative default is 'yes' (tarball inclusion has been on since the start).
+test_tarball_include_default_matches_init_config() {
+ local init_default
+ local applied_default
+
+ test::setup
+
+ # Value a fresh --init config gives the user (the documented default).
+ (
+ cd "$TEST_TMPDIR"
+ SHURIKEN_DEFAULT_RC="$TEST_TMPDIR/missing" \
+ "$TEST_SHURIKEN" --init >/dev/null
+ )
+ init_default=$(
+ set -euo pipefail
+ # shellcheck disable=SC1090,SC1091
+ source "$TEST_TMPDIR/shuriken.conf"
+ printf '%s\n' "$TARBALL_INCLUDE"
+ )
+
+ # Value apply_config_defaults falls back to when the key is left unset.
+ applied_default=$(
+ set -euo pipefail
+ # shellcheck source=/dev/null
+ source <(sed '$d' "$TEST_SHURIKEN")
+ unset -v TARBALL_INCLUDE || true
+ apply_config_defaults
+ printf '%s\n' "$TARBALL_INCLUDE"
+ )
+
+ test "$init_default" = "$applied_default"
+ test "$applied_default" = yes
+ test::teardown
+}
+
test_just_install_and_deinstall_with_destdir() {
local stage_dir
@@ -1499,7 +1538,7 @@ RANDOM_SEED=''
SHUFFLE=no
SPLASH_PAGE=yes
STATS_PAGE=no
-TARBALL_INCLUDE=no
+TARBALL_INCLUDE=yes
TARBALL_SUFFIX=.tar
TAR_TIMEOUT=120
TAR_OPTS=( -c )
@@ -6466,6 +6505,9 @@ main() {
'--init refuses existing config without overwrite' \
test_init_existing_config_fails_without_overwrite
test::run_case \
+ 'TARBALL_INCLUDE default matches between --init config and apply_config_defaults' \
+ test_tarball_include_default_matches_init_config
+ test::run_case \
'just install and deinstall supports DESTDIR' \
test_just_install_and_deinstall_with_destdir
test::run_case '--clean succeeds' test_clean