openbsd-ports/sysutils/heartbeat/patches/patch-tools_utillib_sh
ajacoutot 70a035e920 Import heartbeat-2.1.2-15
The basic goal of the High Availability Linux project is to provide a
high availability (clustering) solution for Linux (and Unix-like) which
promotes reliability, availability, and serviceability (RAS) through a
community development effort.

Inspired from an original submission by Sebastian Reitenbach
(maintainer) whom I want to thank for his work and patience.
2007-11-21 18:48:39 +00:00

30 lines
850 B
Plaintext

$OpenBSD: patch-tools_utillib_sh,v 1.1.1.1 2007/11/21 18:48:40 ajacoutot Exp $
--- tools/utillib.sh.orig Thu Oct 25 09:40:41 2007
+++ tools/utillib.sh Mon Nov 12 11:13:26 2007
@@ -350,14 +350,25 @@ distro() {
warning "no lsb_release no /etc/*-release no /etc/debian_version"
}
hb_ver() {
+ # for Linux .deb based systems
which dpkg > /dev/null 2>&1 && {
dpkg-query -f '${Version}' -W heartbeat 2>/dev/null ||
dpkg-query -f '${Version}' -W heartbeat-2
return
}
+ # for Linux .rpm based systems
which rpm > /dev/null 2>&1 && {
rpm -q --qf '%{version}' heartbeat
return
+ }
+ # for OpenBSD
+ which pkg_info > /dev/null 2>&1 && {
+ pkg_info | grep heartbeat | cut -d "-" -f 2- | cut -d " " -f 1
+ return
+ }
+ # for Solaris
+ which pkginfo > /dev/null 2>&1 && {
+ pkginfo | awk '{print $3}'
}
# more packagers?
}