refactor(compile): merge openssh-tests handling into idempotent guard

Consolidate PATCH 10.4p1-1 comment hack with SKIP -Nopenssh-tests.
Replace s|^|#| with idempotent || true so chmod does not fail when
debian/openssh-tests is skipped (-N). Still required on 10.5p1-1
where upstream debian/rules has unconditional chmod +x.
This commit is contained in:
boypt
2026-09-01 17:14:26 +08:00
parent a68f3c11e2
commit a9f3c50008

View File

@@ -152,9 +152,6 @@ if dpkg --compare-versions $__initsystemhelpers_ver lt '1.66'; then
sed -i '/init-system-helpers/s|1.66|1.50|' debian/control
fi
## PATCH 10.4p1-1
sed -i '/chmod +x debian\/openssh-tests/s|^|#|' debian/rules
## Check build deps
if ! dpkg-checkbuilddeps; then
echo "The build dependencies are not met, run ./install_deps.sh first."
@@ -164,8 +161,9 @@ fi
## Adding distro codename to package names
sed -i "1s|)|~${BUILD_CODENAME})|" debian/changelog
## SKIP openssh-tests pkg
## SKIP openssh-tests (10.4p1-1+): -N + guard chmod when package skipped
sed -i "/^%:/iBUILD_PACKAGES += -Nopenssh-tests\n" debian/rules
sed -i '/chmod +x debian\/openssh-tests/ { /|| true/! s/$/ || true/ }' debian/rules
echo "INFO: Building Package: $(head -n1 debian/changelog)"