From 81a1cb9028b75304b0261dfd91ba04c0e6b07bb4 Mon Sep 17 00:00:00 2001 From: joey Date: Sun, 27 Jan 2002 06:34:33 +0000 Subject: r506: * Introduced the debian/compat file. This is the new, preferred way to say what debhelper compatability level your package uses. It has the big advantage of being available to debhelper when you run it at the command line, as well as in debian/rules. * A new v4 feature: dh_installinit, in v4 mode, will use invoke-rc.d. This is in v4 for testing, but I may well roll it back into v3 (and earlier) once woody is released and I don't have to worry about breaking things (and, presumably, once invoke-rc.d enters policy). * Some debhelper commands will now build up a new substvars variable, ${misc:Depends}, based on things they know your package needs to depend on. For example, dh_installinit in v4 mode adds sysvinit (>= 2.80-1) to that dep list, and dh_installxfonts adds a dep on xutils. This variable should make it easier to keep track of what your package needs to depends on, supplimenting the ${shlibs:Depends} and ${perl:Depends} substvars. Hmm, this appears to be based loosely on an idea by Masato Taruishi , filtered through a long period of mulling it over. Closes: #76352 * Use the addsubstvar function I wrote for the above in dh_perl too. --- dh_perl | 30 ++++++++++++------------------ 1 file changed, 12 insertions(+), 18 deletions(-) (limited to 'dh_perl') diff --git a/dh_perl b/dh_perl index facad8d6..a40c6fd5 100755 --- a/dh_perl +++ b/dh_perl @@ -18,7 +18,7 @@ B [S>] [B<-d>] [S>] =head1 DESCRIPTION dh_perl is a debhelper program that is responsible for generating -the perl:Depends substitutions and adding them to substvars files. +the ${perl:Depends} substitutions and adding them to substvars files. The program will look at perl scripts and modules in your package, and will use this information to generate a dependency. @@ -88,13 +88,8 @@ foreach my $package (@{$dh{DOPACKAGES}}) { my $tmp = tmpdir($package); my $ext = pkgext($package); - # For idempotency, remove anything this program might have - # previously added to the substvars file. - if (-e "debian/${ext}substvars") { - complex_doit("grep -v ^perl:Depends= debian/${ext}substvars > debian/${ext}substvars.new || true"); - doit("mv", "debian/${ext}substvars.new","debian/${ext}substvars"); - } - + delsubstvar($package, "perl:Depends"); # for idempotency + # Check also for alternate locations given on the command line my @dirs = grep -d, map "$tmp/$_", $vendorlib, $vendorarch, @ARGV; @@ -118,25 +113,24 @@ foreach my $package (@{$dh{DOPACKAGES}}) { }, $tmp; if ($deps) { - my $perl_depends = $perl; + my $version=""; if ($deps & XS_MODULE or $dh{V_FLAG_SET}) { ($version) = `dpkg -s $perl` =~ /^Version:\s*(\S+)/m unless $version; - $perl_depends .= " (>= $version)"; + $version = ">= $version"; } elsif ($deps & PM_MODULE) { - $perl_depends .= " (>= $min_version)"; + $version = ">= $min_version"; } + + # no need to depend on an un-versioned perl-base -- it's + # essential + addsubstvar($package, "perl:Depends", $perl, $version) + unless $perl eq 'perl-base' && ! length($version); # add perlapi- for XS modules - $perl_depends .= ", perlapi-$Config{version}" + addsubstvar($package, "perl:Depends", "perlapi-$Config{version}") if $deps & XS_MODULE; - - # don't need to depend on an un-versioned perl-base, it's - # essential - unless ($perl_depends eq 'perl-base') { - complex_doit("echo 'perl:Depends=$perl_depends' >> debian/${ext}substvars"); - } } } -- cgit v1.2.3