Bug#1042004: systemd: systemd-run evaluates variables enclosed between single quotes

Raphaël Halimi raphael.halimi at gmail.com
Tue Jul 25 15:47:42 BST 2023


Package: systemd
Version: 254~rc1-2
Affects: pbuilder

Dear maintainers,

Yesterday I tried to build a package with pbuilder and it resulted in an 
error when trying to satisfy build dependencies:

Referenced but unset environment variable evaluates to an empty string: 
Version
dpkg-query: error in show format: may not be empty string

/usr/lib/pbuilder/pbuilder-satisfydepends-apt checks for apt's version 
with the function package_version_is_older_than, which is defined in 
/usr/lib/pbuilder/pbuilder-modules:

dpkg --compare-versions "$($CHROOTEXEC dpkg-query -W 
--showformat='${Version}' "$1")" lt "$2"

CHROOTEXEC is defined in /usr/lib/pbuilder/pbuilder-checkparams:

CHROOTEXEC="chroot $BUILDPLACE "

And then (if systemd is running and its version is greater than 215) :

systemctl_run=(
   systemd-run
   --quiet
   --scope
   --description="pbuilder_${PBUILDER_OPERATION}${1:+_"$(basename "$1")"}"
   --slice="$SYSTEMD_SLICE"
)
CHROOTEXEC="${systemctl_run[*]} $CHROOTEXEC"

So the resulting systemd-run command evaluates '${Version}' (in the 
dpkg-query command) to an empty string. It shouldn't be evaluated since 
it's enclosed between single quotes.

Downgrading systemd to version 253.5-1 fixes the problem.

Regards,

-- 
Raphaël Halimi



More information about the Pkg-systemd-maintainers mailing list