summaryrefslogtreecommitdiff
path: root/dh_testversion
diff options
context:
space:
mode:
authorjoey <joey>1999-08-17 04:56:23 +0000
committerjoey <joey>1999-08-17 04:56:23 +0000
commita4caa9e05bc2b7e4ea034026cf0b2cda3461d4b2 (patch)
tree9c3bac7b403a289684ff62d50bad453b6166cf46 /dh_testversion
parent9bedb167c1a8b07ec70e0f98f5bdfb8ef0f1119e (diff)
r103: Initial revision
Diffstat (limited to 'dh_testversion')
-rwxr-xr-xdh_testversion24
1 files changed, 24 insertions, 0 deletions
diff --git a/dh_testversion b/dh_testversion
new file mode 100755
index 0000000..57c0e58
--- /dev/null
+++ b/dh_testversion
@@ -0,0 +1,24 @@
+#!/usr/bin/perl -w
+#
+# Debhelper version check.
+
+BEGIN { push @INC, "debian", "/usr/lib/debhelper" }
+use Dh_Lib;
+use Dh_Version; # contains the version number of debhelper.
+init();
+
+my($compare, $ver);
+
+if ($#ARGV > 0) {
+ $compare=shift;
+ $ver=shift;
+}
+elsif ($#ARGV eq 0) {
+ $compare=">=";
+ $ver=shift;
+}
+
+if (defined $compare and defined $ver) {
+ system('dpkg','--compare-versions',$Dh_Version::version,$compare,$ver) == 0 ||
+ error("debhelper version $Dh_Version::version is installed, but a version $compare $ver is needed to build this package.");
+}