Bug#27777: dpkg-buildpackage don't work with LANG set
Package: dpkg-dev
Version: 1.4.0.30
If I call dpkg-buildpackage with LANG set to something else than C or
POSIX I get the following error message:
~/tmp/wwwoffle-2.0$ LANG=de_DE dpkg-buildpackage
parsechangelog/debian: error: unable to open substvars file debian/substvars: Datei oder Verzeichnis nicht gefunden
dpkg-buildpackage: unable to determine source package
(The error message means: File or directory not found).
If I use an english locale or set LANG to C or POSIX it works as expected:
~/tmp/wwwoffle-2.0$ LANG=C dpkg-buildpackage
dpkg-buildpackage: source package is wwwoffle
dpkg-buildpackage: source version is 2.0-1
[...]
I tried all the locale specific variables and it seems that the
LC_MESSAGES setting is to blame, e.g.
LC_MESSAGE=de_DE dpkg-buildpackage
yields the same error message.
I found the following part around line 89 in /usr/lib/dpkg/controllib.pl:
} elsif ($! !~ m/no such file or directory/i) {
&error("unable to open substvars file $varlistfile: $!");
}
The reason for the problem is obvious, with the above setting the
error message is not the expected one.
Maybe you should set LC_MESSAGES inside this script to POSIX to get
the correct error message. Unfortunately, I don't know the Perl way
for doing it, but a
$ENV{'LC_MESSAGES'}='POSIX';
at the begin of controllib.pl was sufficient.
Torsten
Reply to: