Bug#714544: debhelper: Please use "--" long option prefixes for Perl's Module::Build build system
Package: debhelper
Version: 9.20130626
Severity: normal
Tags: patch
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
While packaging Module::Build::Tiny [0], I stumbled about a problem in
debhelper. In the perl_module build system, it uses the key=var type
of passing options.
While this works fine with Module::Build which accepts all kinds of
styles, if fails with Module::Build::Tiny, which insists on the
"--key value" style.
I've discussed this with upstream [1], who pointed out that
- - using the "--" long prefix version is the
"next-gen-perl-build-tool"
- - which is based on the now developped Build.PL spec [2]
- - will probably be required by more consumers of Build.PL in the
future
At the moment we have one package waiting for Module::Build::Tiny in
git but more are piling up on the CPAN.
AFAICS, using the "--" long prefix variant works just fine for
traditional Module::Build using packages, so this change is backwards
compatible.
Find attached a patch against Buildsystem/perl_build.pm. I've tested
it by building around two dozens Build.PL using packages (both
arch:all and arch:any) with debhelper and this patch, and I haven't
seen any problems.
(I also took the liberty to reorder the arguments in the clean target
to match the rest.)
Cheers,
gregor
[0]
https://metacpan.org/release/Module-Build-Tiny
[1]
https://rt.cpan.org/Ticket/Display.html?id=85006
[2]
https://github.com/Perl-Toolchain-Gang/cpan-api-buildpl/blob/master/lib/CPAN/API/BuildPL.pm
- -- System Information:
Debian Release: jessie/sid
APT prefers unstable
APT policy: (990, 'unstable'), (500, 'experimental'), (500, 'testing'), (500, 'stable'), (500, 'oldstable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 3.9-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=C, LC_CTYPE=de_AT.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
Versions of packages debhelper depends on:
ii binutils 2.23.52.20130620-1
ii dpkg 1.16.10
ii dpkg-dev 1.16.10
ii file 1:5.14-2
ii man-db 2.6.5-2
ii perl 5.14.2-21
ii po-debconf 1.0.16+nmu2
debhelper recommends no packages.
Versions of packages debhelper suggests:
ii dh-make 0.62
- -- no debconf information
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
iQIcBAEBCAAGBQJR0FkuAAoJELs6aAGGSaoGdjMP/2A+FR09IH4ELBEJ2IkrqvXu
wT3905AMEGhHW40B6Th9z24ca6WjLzK3SJSe6x6tq0NT88z8KvDQOqf5kyISngv5
7Q/9XZXOvFn13ccCRUZmSuVEjU6r0BpA4WTm7tuLk49o/vnkZPgqDjlcUJnebf8c
2Svw13XaMb/97EoPoO3kB7JA3SM+4XnprZXPt5A9yNz2Q9cTdLEoQIZC2zgyd4la
iVbSasVHg9Zvul0EIb2FtHs4IBDzipbOlce1pB4Wap5neoSCC8XhY8r6i5xa3Rva
pYCnPSvOnApHIlyGMjO9NQswSRtEeUjPbfqsO0z2DKcNTNzama75pyHu9Zi0e1jq
v13cO57ro0u+Xge+cSXWpCIFwxB81kYNukKS5O3k7SV+r8Ob0toUDzO0ZjUdL8K8
6VPB3xpqJip2Xu+QAZTaYo6VtpQqArywgKctb2YUXc5lGUwI2Fj2UtlmE5u/0DxR
DsZa3+8F+pOmMrj0/P8uWKeb6cc27Vp2a3pQB0WFS/6c1Png0+4mmyH6MOSaQgUt
5NcmtHzTM4OR4c2aiw2ruiq9lEb4RYTn6oCv/tz5IzwI2LVhrY+TXc/YrjqYavc4
0LDZFdX/iRIrvvMipshN7xulgHUCywhB9DLaWjUPMP8OIEw1VLKUP+zaAo4/zAZM
YO/8x+1YGDt6lpWInbXx
=qsSy
-----END PGP SIGNATURE-----
diff --git a/Debian/Debhelper/Buildsystem/perl_build.pm b/Debian/Debhelper/Buildsystem/perl_build.pm
index 671bca5..bfe1c08 100644
--- a/Debian/Debhelper/Buildsystem/perl_build.pm
+++ b/Debian/Debhelper/Buildsystem/perl_build.pm
@@ -43,12 +43,12 @@ sub configure {
my @flags;
$ENV{PERL_MM_USE_DEFAULT}=1;
if ($ENV{CFLAGS} && ! compat(8)) {
- push @flags, "config=optimize=$ENV{CFLAGS} $ENV{CPPFLAGS}";
+ push @flags, "--config", "optimize=$ENV{CFLAGS} $ENV{CPPFLAGS}";
}
if ($ENV{LDFLAGS} && ! compat(8)) {
- push @flags, "config=ld=$Config{ld} $ENV{CFLAGS} $ENV{LDFLAGS}";
+ push @flags, "--config", "ld=$Config{ld} $ENV{CFLAGS} $ENV{LDFLAGS}";
}
- $this->do_perl("Build.PL", "installdirs=vendor", @flags, @_);
+ $this->do_perl("Build.PL", "--installdirs", "vendor", @flags, @_);
}
sub build {
@@ -64,13 +64,13 @@ sub test {
sub install {
my $this=shift;
my $destdir=shift;
- $this->do_perl("Build", "install", "destdir=$destdir", "create_packlist=0", @_);
+ $this->do_perl("Build", "install", "--destdir", "$destdir", "--create_packlist", 0, @_);
}
sub clean {
my $this=shift;
if (-e $this->get_sourcepath("Build")) {
- $this->do_perl("Build", "--allow_mb_mismatch", 1, "distclean", @_);
+ $this->do_perl("Build", "distclean", "--allow_mb_mismatch", 1, @_);
}
}
Reply to: