[Git][qa/jenkins.debian.net][master] pbuilder: Use `printenv` instead of `set` to show environment variables

Holger Levsen (@holger) gitlab at salsa.debian.org
Wed May 13 09:30:21 BST 2026



Holger Levsen pushed to branch master at Debian QA / jenkins.debian.net


Commits:
5d25deaa by Gioele Barabucci at 2026-05-13T10:30:11+02:00
pbuilder: Use `printenv` instead of `set` to show environment variables

Bash and Dash show the output of `set` in a slightly different format
(for example `USER='foo'` vs `USER=foo`).  This confuses `diff` and causes
noise in the build log diffs.

Comparing the sorted output of `printenv` fixes this issue.

Using `printenv` has the additional advantage of showing only real
_environment_ variables (i.e. the set of variables that will be seen by
child processes) and no _shell_ variables (i.e. variables visible in the
shell but not exported to child processes like `PS1`).

Note: the full path is needed to prevent shells from using their
internal implementation of `printenv`.

(cherry picked from commit 0389d001456a64ebbb0f04627d00a6f077e7376c)
Signed-off-by: Holger Levsen <holger at layer-acht.org>

- - - - -


1 changed file:

- hosts/common/etc/pbuilder/rebuild-hooks/D02_print_environment


Changes:

=====================================
hosts/common/etc/pbuilder/rebuild-hooks/D02_print_environment
=====================================
@@ -9,6 +9,6 @@ Echo () {
 	eval "${@}" | sed 's@^@  @g'
 }
 
-Echo set
+Echo "/usr/bin/printenv | LC_ALL=C.UTF-8 sort"
 Echo uname -a
 Echo ls -l /bin



View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/-/commit/5d25deaa2c86fadfc2291e24261c598d8aa63e1e

-- 
View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/-/commit/5d25deaa2c86fadfc2291e24261c598d8aa63e1e
You're receiving this email because of your account on salsa.debian.org. Manage all notifications: https://salsa.debian.org/-/profile/notifications | Help: https://salsa.debian.org/help


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/qa-jenkins-scm/attachments/20260513/f69c721e/attachment-0001.htm>


More information about the Qa-jenkins-scm mailing list