5 dh_testversion - ensure that the correct version of debhelper is installed
9 use Debian::Debhelper::Dh_Lib;
10 use Debian::Debhelper::Dh_Version; # contains the version number of debhelper.
14 B<dh_testversion> [S<I<debhelper options>>] [I<operator>] [I<version>]
18 Note: This program is deprecated. You should use build dependencies
21 dh_testversion compares the version of debhelper against the version you
22 specify, and if the condition is not met, exits with an error message.
24 You can use this in your debian/rules files if a new debhelper feature is
25 introduced, and your package requires that feature to build correctly. Use
26 debhelper's changelog to figure out the version you need.
28 Be sure not to overuse dh_testversion. If debhelper version 9.5
29 introduces a new dh_autofixbugs command, and your package uses it, then if
30 someone tries to build it with debhelper 1.0, the build will fail anyway when
31 dh_autofixbugs cannot be found, so there is no need for you to use
40 Optional comparison operator used in comparing the versions. If not
41 specified, ">=" is used. For descriptions of the comparison operators, see
46 Version number to compare against the current version of debhelper. If not
47 specified, dh_testversion does nothing.
67 warning("This program is deprecated, you should use build dependencies instead.");
69 if (defined $compare and defined $ver) {
70 warning("Something like: \"Build-Depends: debhelper ($compare $ver)\"");
71 system('dpkg','--compare-versions',$Debian::Debhelper::Dh_Version::version,$compare,$ver) == 0 ||
72 error("debhelper version $Debian::Debhelper::Dh_Version::version is installed, but a version $compare $ver is needed to build this package.");
79 This program is a part of debhelper.
83 Joey Hess <joeyh@debian.org>