From b18201805c64970a9a439637beee52b981160d8e Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 29 Dec 2009 15:27:20 -0500 Subject: 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. --- dh_installdebconf | 3 --- 1 file changed, 3 deletions(-) (limited to 'dh_installdebconf') 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"); -- cgit v1.2.3