summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Scherbaum <dertobi123@gentoo.org>2008-06-08 16:31:25 +0000
committerTobias Scherbaum <dertobi123@gentoo.org>2008-06-08 16:31:25 +0000
commit5b882b4aa6a6ac182d6768b53b1913e4fb91d01d (patch)
tree572fe817415ab2f2c45f0f4e7b30c0c9d080dbfb /net-analyzer/nagios
parentstable on sparc, bug #224379 (diff)
downloadgentoo-2-5b882b4aa6a6ac182d6768b53b1913e4fb91d01d.tar.gz
gentoo-2-5b882b4aa6a6ac182d6768b53b1913e4fb91d01d.tar.bz2
gentoo-2-5b882b4aa6a6ac182d6768b53b1913e4fb91d01d.zip
Add check if we are upgrading from <nagios-3.
(Portage version: 2.1.5.4)
Diffstat (limited to 'net-analyzer/nagios')
-rw-r--r--net-analyzer/nagios/ChangeLog5
-rw-r--r--net-analyzer/nagios/nagios-3.0.2.ebuild29
2 files changed, 32 insertions, 2 deletions
diff --git a/net-analyzer/nagios/ChangeLog b/net-analyzer/nagios/ChangeLog
index a55c6fc24405..b18a9cf19908 100644
--- a/net-analyzer/nagios/ChangeLog
+++ b/net-analyzer/nagios/ChangeLog
@@ -1,6 +1,9 @@
# ChangeLog for net-analyzer/nagios
# Copyright 2002-2008 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-analyzer/nagios/ChangeLog,v 1.69 2008/05/29 13:02:52 dertobi123 Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-analyzer/nagios/ChangeLog,v 1.70 2008/06/08 16:31:25 dertobi123 Exp $
+
+ 08 Jun 2008; Tobias Scherbaum <dertobi123@gentoo.org> nagios-3.0.2.ebuild:
+ Add check if we are upgrading from <nagios-3.
29 May 2008; Tobias Scherbaum <dertobi123@gentoo.org> nagios-3.0.2.ebuild:
Adjust nagios-plugins dep
diff --git a/net-analyzer/nagios/nagios-3.0.2.ebuild b/net-analyzer/nagios/nagios-3.0.2.ebuild
index f797ec2f3710..8bb730186953 100644
--- a/net-analyzer/nagios/nagios-3.0.2.ebuild
+++ b/net-analyzer/nagios/nagios-3.0.2.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/net-analyzer/nagios/nagios-3.0.2.ebuild,v 1.2 2008/05/29 13:02:52 dertobi123 Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-analyzer/nagios/nagios-3.0.2.ebuild,v 1.3 2008/06/08 16:31:25 dertobi123 Exp $
DESCRIPTION="The Nagios metapackage - merge this to pull install all of the
nagios packages"
@@ -15,6 +15,33 @@ RDEPEND="~net-analyzer/nagios-core-${PV}
>=net-analyzer/nagios-plugins-1.4.12-r100
>=net-analyzer/nagios-imagepack-1.0-r100"
+pkg_setup() {
+ # Avoid upgrading from Nagios <3 as the directory structure has changed
+ if [[ -f /var/lib/init.d/started/nagios ]] ; then
+ if has_version '<net-analyzer/nagios-3.0' ; then
+ if [[ "${FORCE_UPGRADE}" ]] ; then
+ echo
+ ewarn "you are upgrading from an incompatible version and have"
+ ewarn "FORCE_UPGRADE set, will build this package while Nagios is running."
+ echo
+ else
+ echo
+ eerror "You are upgrading from an incompatible version."
+ eerror "Please be advised that installation paths have changed to a more FHS"
+ eerror "compliant structure and you won't be able to easily upgrade to"
+ eerror "Nagios 3 therefore. You will have to change your configuration"
+ eerror "to reflect this change, for example Nagios plugins are now installed"
+ eerror "into /usr/$(get_libdir)/nagios/plugins/ instead of /usr/nagios/libexec."
+ echo
+ eerror "If you want to upgrade now, emerge nagios with:"
+ eerror " FORCE_UPGRADE=1 emerge nagios"
+ die "Upgrading from an incompatible version!"
+ echo
+ fi
+ fi
+ fi
+}
+
pkg_postrm() {
elog "Note: this is a META ebuild for ${P}."
elog "to remove it completely or before re-emerging"