|author||Joey Hess <email@example.com>||2009-12-29 15:27:20 -0500|
|committer||Joey Hess <firstname.lastname@example.org>||2009-12-29 15:27:20 -0500|
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.
Diffstat (limited to 'doc')
1 files changed, 4 insertions, 3 deletions
diff --git a/doc/PROGRAMMING b/doc/PROGRAMMING
index 0fca472..ca76b9c 100644
@@ -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.
This function removes the entire line for the substvar from the
package's shlibs file.