File: dh_testversion

package info (click to toggle)
debhelper 2.0.86
  • links: PTS
  • area: main
  • in suites: potato
  • size: 616 kB
  • ctags: 49
  • sloc: perl: 1,842; makefile: 251; sh: 5
file content (24 lines) | stat: -rwxr-xr-x 558 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/perl -w
#
# Debhelper version check.

BEGIN { push @INC, "debian", "/usr/share/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.");
}