summaryrefslogtreecommitdiff
path: root/dh_testversion.in
blob: 9e2f14efb5f51e8fe3f87305b51b706d074ec5fd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/sh -e
#
# Debhelper version check.

# Current version of debhelper is:
DH_VERSION=#DEBHELPER_VERSION#

PATH=debian:$PATH:/usr/lib/debhelper
. dh_lib

if [ "$1" -a "$2" ]; then
	compare=$1
	ver=$2
elif [ "$1" ]; then
	compare=">="
	ver=$1
fi

if [ "$compare" -a "$ver" ] ; then
	if ! dpkg --compare-versions $DH_VERSION $compare $ver; then
		error "debhelper version $DH_VERSION is installed, but a version $compare $ver is needed to build this package."
	fi
fi