diff mbox series

ca-certificates: postinst shift count out of range error

Message ID HrS5.1747939211095331723.J22A@lists.openembedded.org
State New
Headers show
Series ca-certificates: postinst shift count out of range error | expand

Commit Message

WXbet@proton.me May 22, 2025, 6:40 p.m. UTC
We see the following error maybe introduced with commit ca-certificates: submit sysroot patch upstream, drop default-sysroot.… · openembedded/openembedded-core@90d9f0b ( https://github.com/openembedded/openembedded-core/commit/90d9f0ba674d4fe8e9291f0513c13dff3775c545#diff-fea5ef51cd53e027c02d43f853be31c492bdbe8de48cfbe268bb6b1bcad5f162 )

Configuring ca-certificates.
/usr/sbin/update-ca-certificates: line 75: shift: shift count out of range
error: pkg_run_script: package "ca-certificates" postinst script returned status 1.
error: opkg_configure: ca-certificates.postinst returned 1.

The postinst part in ipkg looks like:
set -e
$D/usr/sbin/update-ca-certificates --sysroot $D

Created from: https://github.com/openembedded/openembedded-core/commit/90d9f0ba674d4fe8e9291f0513c13dff3775c545#diff-d521676128cddb868864b5c8355a22f3245674db0e721c3458f7c35681ebd712R64-R65
Parameter $D is empty and so the shift-command fails.

Looks like there is a missing slash at the end of `$D${sbindir}/update-ca-certificates --sysroot $D`

or

the shift error in update-ca-certificates could be avoided with a patch like this:
diff mbox series

Patch

diff --git a/sbin/update-ca-certificates b/sbin/update-ca-certificates
index 91d8024..0122c99 100755
--- a/sbin/update-ca-certificates
+++ b/sbin/update-ca-certificates
@@ -71,7 +71,7 @@  do
echo "$0: [--verbose] [--fresh]"
exit;;
esac
-  shift
+  [ $# -gt 0 ] && shift
done

if [ ! -s "$CERTSCONF" ]