summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Hess <joey@gnu.kitenet.net>2009-12-29 15:27:20 -0500
committerJoey Hess <joey@gnu.kitenet.net>2009-12-29 15:27:20 -0500
commitb18201805c64970a9a439637beee52b981160d8e (patch)
treeda21b4c2646c7ecbbfa7a2ec87453141bb13431e
parent29ce222e43b69ee8bec4c471c2cafdb7a293068c (diff)
downloaddebhelper-b18201805c64970a9a439637beee52b981160d8e.tar.gz
stop trying to handle substvars idempotently
In the beginning, I tried to be careful to have commands that added a substvar remove it when ran again with different options that caused it to not be needed. However, now when I look over the code, I see 3 places that got it right, 1 that was right but I just broke, and a dozen that don't even try to handle this case. Also, handling the case is hard; code that adds substvars may be complex and calculate versioned dependencies. The removal code then has to somehow also come up with those same exact dependency strings. It's a recipe for nasty code and maintenance headache even if I went and fixed everything right now. Instead, I dropped the whole thing. Many debhelper commands make no pretense of being idempotent anyway; it's easy and normal to call dh_prep when starting a binary package build, with the exact purpose of not needing to worry about idempotency. I did leave in the delsubstvar function, as well as the option to addsubstvar that, confusingly, causes an item to be removed. Just for library compatability reasons.
-rwxr-xr-xdh_installdebconf3
-rwxr-xr-xdh_installxfonts4
-rwxr-xr-xdh_perl2
-rwxr-xr-xdh_python2
-rw-r--r--doc/PROGRAMMING7
5 files changed, 4 insertions, 14 deletions
diff --git a/dh_installdebconf b/dh_installdebconf
index ff49f8ea..3e51f8ee 100755
--- a/dh_installdebconf
+++ b/dh_installdebconf
@@ -117,9 +117,6 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
if ($config ne '' || $templates ne '') {
addsubstvar($package, "misc:Depends", $debconfdep);
}
- else {
- addsubstvar($package, "misc:Depends", $debconfdep, undef, 1); # remove
- }
if (($config ne '' || $templates ne '') && ! $dh{NOSCRIPTS}) {
autoscript($package,"postrm","postrm-debconf");
diff --git a/dh_installxfonts b/dh_installxfonts
index 21e7fcec..25e073bc 100755
--- a/dh_installxfonts
+++ b/dh_installxfonts
@@ -82,10 +82,6 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
addsubstvar($package, "misc:Depends", "xfonts-utils");
}
- else {
- # remove
- addsubstvar($package, "misc:Depends", "xfonts-utils", "", 1);
- }
}
=head1 SEE ALSO
diff --git a/dh_perl b/dh_perl
index eaa08fa8..d43043fa 100755
--- a/dh_perl
+++ b/dh_perl
@@ -90,8 +90,6 @@ use constant XS_MODULE => 4;
foreach my $package (@{$dh{DOPACKAGES}}) {
my $tmp=tmpdir($package);
- 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;
diff --git a/dh_python b/dh_python
index 8f8c3788..d7a4bed7 100755
--- a/dh_python
+++ b/dh_python
@@ -135,8 +135,6 @@ use constant SO_MODULE_NONSTANDARD => 16;
foreach my $package (@{$dh{DOPACKAGES}}) {
my $tmp = tmpdir($package);
- delsubstvar($package, "python:Depends");
-
my @dirs = ("usr/lib/site-python", "usr/lib/$package", "usr/share/$package", "usr/lib/games/$package", "usr/share/games/$package", @ARGV );
my @dirs_so = ("usr/lib/site-python", @ARGV );
diff --git a/doc/PROGRAMMING b/doc/PROGRAMMING
index 0fca4722..ca76b9c9 100644
--- a/doc/PROGRAMMING
+++ b/doc/PROGRAMMING
@@ -216,9 +216,10 @@ addsubstvar($package, $substvar, $deppackage, $verinfo, $remove)
- version info for the package (optional) (ie: ">= 1.1")
- if this last parameter is passed, the thing that would be added
is removed instead. This can be useful to ensure that a debhelper
- command is idempotent. Note that without this parameter, if you
- call the function twice with the same values it will only add one
- item to the substvars file.
+ command is idempotent. (However, we generally don't bother,
+ and rely on the user calling dh_prep.) Note that without this
+ parameter, if you call the function twice with the same values it
+ will only add one item to the substvars file.
delsubstvar($package, $substvar)
This function removes the entire line for the substvar from the
package's shlibs file.