#1145335 debrebuild: mmdebstrap builder passes env-var count as a command

Package:
devscripts
Source:
devscripts
Description:
scripts to make the life of a Debian Package maintainer easier
Submitter:
Serge Schneider
Date:
2026-08-26 00:47:02 UTC
Severity:
normal
Tags:
#1145335#5
Date:
2026-08-24 09:46:37 UTC
From:
To:
Dear Maintainer,

The refactor of the mmdebstrap builder that closed #1140552 introduced
another issue. It now makes all debrebuild --builder=mmdebstrap commands
fail if anything is set in the Environment section.

The trailing string concatenation forces `map` into scalar context, in
which it returns the count of elements. For a buildinfo with N Environment
lines the customize-hook becomes `env --chdir=<path> N dpkg-buildpackage
...`, and env fails with `env: 'N': No such file or directory`.

It's reproducible by running the following:

  $ curl -sfLO
https://buildinfos.debian.net/buildinfo-pool/h/hello/hello_2.12.3-1_amd64.buildinfo
  $ debrebuild --builder=mmdebstrap --buildresult=./out
hello_2.12.3-1_amd64.buildinfo
  [...]
  I: running --chrooted-customize-hook in shell: sh -c 'env
--chdir=/build/reproducible-path/hello-2.12.3 5 dpkg-buildpackage -uc -a
amd64 --build=any'
  env: '5': No such file or directory
  E: command failed: env --chdir=/build/reproducible-path/hello-2.12.3 5
dpkg-buildpackage -uc -a amd64 --build=any

I've attached a patch that resolves the problem for me.

Kind regards,

Serge
--- /etc/devscripts.conf --- Empty.
--- ~/.devscripts --- Not present
#1145335#8
Date:
2026-08-26 00:44:15 UTC
From:
To:
Hello,

Bug #1145335 in devscripts reported by you has been fixed in the
Git repository and is awaiting an upload. You can see the commit
message below and you can check the diff of the fix at:

https://salsa.debian.org/debian/devscripts/-/commit/83d5d2b9b4bfcd160346885e980eb738063b0652
------------------------------------------------------------------------
debrebuild: join env-var list in mmdebstrap chrooted-customize-hook

The trailing string concatenation forced `map` into scalar context, in
which it returns the count of elements, not the mapped list. env(1) then
received that count as its command and failed with `env: 'N': No such
file or directory`.

Regression from #1140552.

Closes: #1145335
Thanks: Agustin Martin Domingo <agmartin@debian.org>
------------------------------------------------------------------------

(this message was generated automatically)
-- 
Greetings

https://bugs.debian.org/1145335