On Thu, 08 Dec 2011 23:03:55 -0400, Joey Hess wrote:
Hi Joey,
thanks for taking the time to look into this request!
> > In patch 0001-dh_perl-add-S-_s_ameperl-switch-in-v9.patch I've added
> > a -S switch, that adds exactly these values to ${perl:Depends}, and
> > can be used with d/compat=9 and
> >
> > override_dh_perl:
> > dh_perl -S
> There's no reason to make this contingent on a compat level, it cannot
> possibly break anything sane to add a switch.
Ok, good point.
> The patch would be better if it included documentation. Concisely
> documenting how -S is different than -V and when -S should be used seems
> difficult.
-V sets the minimum, -S sets both the minimum and the maximum perl
version, i.e. restricts the dependency to the exact perl version the
package is built against.
perldoc output at the moment (-V unchanged, -S added by me):
-V By default, scripts and architecture independent modules don't depend on any specific version
of perl. The -V option causes the current version of the perl (or perl-base with -d) package
to be specified.
-S The -S option (mnemonic: _s_ame perl version), adds perl (>= $currentversion) and perl (<<
$nextminorversion~) to ${perl:Depends} (or perl-base with -d), in order to allow packages to
depend on the exact same perl version they are built against. This is independent of arch:all
or arch:any.
(Another difference is that -V uses dpkg and thereby gets the
_package_ version with the Debian revision, -S uses %Config and takes
>= $Config{version} and << $Config{version} + 1.)
So -V adds "perl (>= 5.14.2-6)", and -S adds "perl (>= 5.14.2), perl
(<< 5.14.3~)" at the moment.
> What packages currently have such a tight dependency on perl?
A couple, a quick grep over the pkg-perl git repos shows:
- libclass-xsaccessor-perl
- libdevel-cover-perl
- libpar-packer-perl
> > > > How about providing a new substvar? Something like ${perl:Same} or
> > > > ${perl:Built}
> But I don't see a reason to support both these methods, and the -S
> method seems simpler.
Agreed.
Attached is an updated patch that removes the v9 restriction and
contains the updated POD quoted above.
Cheers,
gregor
--
.''`. Homepage: http://info.comodo.priv.at/ - OpenPGP key ID: 0x8649AA06
: :' : Debian GNU/Linux user, admin, & developer - http://www.debian.org/
`. `' Member of VIBE!AT & SPI, fellow of Free Software Foundation Europe
`- NP: Paul McCartney: Jet
From 6bb49825b23f0511fa389ccf18e9cafc53e1a9ed Mon Sep 17 00:00:00 2001
From: gregor herrmann <gregoa@debian.org>
Date: Fri, 9 Dec 2011 00:55:55 +0100
Subject: [PATCH] dh_perl: add -S (_s_ameperl) switch
The -S switch will add e.g. "perl (>= 5.14.2)" and "perl (<< 5.14.3~)" to
the ${perl:Depends} variable for packages that need the exact perl version
they are built against.
Closes: #579112
---
dh_perl | 20 ++++++++++++++++++--
1 files changed, 18 insertions(+), 2 deletions(-)
diff --git a/dh_perl b/dh_perl
index bf2506c..161ac54 100755
--- a/dh_perl
+++ b/dh_perl
@@ -13,7 +13,7 @@ use Debian::Debhelper::Dh_Lib;
=head1 SYNOPSIS
-B<dh_perl> [S<I<debhelper options>>] [B<-d>] [S<I<library dirs> ...>]
+B<dh_perl> [S<I<debhelper options>>] [B<-d>] [B<-V>] [B<-S>] [S<I<library dirs> ...>]
=head1 DESCRIPTION
@@ -49,6 +49,14 @@ By default, scripts and architecture independent modules don't depend
on any specific version of B<perl>. The B<-V> option causes the current
version of the B<perl> (or B<perl-base> with B<-d>) package to be specified.
+=item B<-S>
+
+The B<-S> option (mnemonic: _s_ame perl version), adds B<perl (E<gt>=
+$currentversion)> and B<perl (<< $nextminorversion~)> to B<${perl:Depends}>
+(or B<perl-base> with B<-d>), in order to allow packages to depend on the
+exact same perl version they are built against. This is independent of
+arch:all or arch:any.
+
=item I<library dirs>
If your package installs Perl modules in non-standard
@@ -66,7 +74,7 @@ Perl policy, version 1.20
=cut
-init();
+init(options => { S => \$dh{S_FLAG} });
my $vendorlib = substr $Config{vendorlib}, 1;
my $vendorarch = substr $Config{vendorarch}, 1;
@@ -131,6 +139,14 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
addsubstvar($package, "perl:Depends",
"perlapi-" . ($Config{debian_abi} || $Config{version}))
if $deps & XS_MODULE;
+
+ if ($dh{S_FLAG}) {
+ my $currentversion = ">= $Config{version}";
+ my ($v1, $v2, $v3) = split /\./, $Config{version};
+ my $nextversion = "<< " . (join ".", $v1, $v2, $v3 + 1) . "~";
+ addsubstvar($package, "perl:Depends", $perl, $currentversion);
+ addsubstvar($package, "perl:Depends", $perl, $nextversion);
+ }
}
# MakeMaker always makes lib and share dirs, but typically
--
1.7.7.3
Attachment:
signature.asc
Description: Digital signature