From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-996691-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by finch.gentoo.org (Postfix) with ESMTPS id 9A885138330
	for <garchives@archives.gentoo.org>; Tue,  9 Jan 2018 21:07:51 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 87EA6E0B9A;
	Tue,  9 Jan 2018 21:07:50 +0000 (UTC)
Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4])
	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id 60DF4E0B9A
	for <gentoo-commits@lists.gentoo.org>; Tue,  9 Jan 2018 21:07:50 +0000 (UTC)
Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84])
	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id BE05E335C37
	for <gentoo-commits@lists.gentoo.org>; Tue,  9 Jan 2018 21:07:47 +0000 (UTC)
Received: from localhost.localdomain (localhost [IPv6:::1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id 4F4AA1A6
	for <gentoo-commits@lists.gentoo.org>; Tue,  9 Jan 2018 21:07:46 +0000 (UTC)
From: "Michael Orlitzky" <mjo@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: 8bit
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Michael Orlitzky" <mjo@gentoo.org>
Message-ID: <1515531395.b1bab70c44f772993901189cfe8eab4324db544e.mjo@gentoo>
Subject: [gentoo-commits] repo/gentoo:master commit in: net-analyzer/arpwatch/
X-VCS-Repository: repo/gentoo
X-VCS-Files: net-analyzer/arpwatch/arpwatch-2.1.15-r10.ebuild net-analyzer/arpwatch/arpwatch-2.1.15-r11.ebuild
X-VCS-Directories: net-analyzer/arpwatch/
X-VCS-Committer: mjo
X-VCS-Committer-Name: Michael Orlitzky
X-VCS-Revision: b1bab70c44f772993901189cfe8eab4324db544e
X-VCS-Branch: master
Date: Tue,  9 Jan 2018 21:07:46 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
X-Archives-Salt: 3f646745-9701-49e2-a52c-49b04f9010c2
X-Archives-Hash: e1bc30115f7365fae6db902b4cf489bd

commit:     b1bab70c44f772993901189cfe8eab4324db544e
Author:     Michael Orlitzky <mjo <AT> gentoo <DOT> org>
AuthorDate: Tue Jan  9 20:54:39 2018 +0000
Commit:     Michael Orlitzky <mjo <AT> gentoo <DOT> org>
CommitDate: Tue Jan  9 20:56:35 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b1bab70c

net-analyzer/arpwatch: new revision to fix the upgrade path.

All revisions before -r10 install /var/lib/arpwatch with the wrong
ownership. The -r10 revision fixes that for new installs, but doesn't
modify ${ROOT}/var/lib/arpwatch for upgraders. This new -r11 adds a
pkg_postinst function to correct the issue for upgraders.

The revision also changes one "dodir" back to "keepdir", fixing a
mistake that I made in -r10.

Closes: https://bugs.gentoo.org/554222
Package-Manager: Portage-2.3.13, Repoman-2.3.3

 ...2.1.15-r10.ebuild => arpwatch-2.1.15-r11.ebuild} | 21 +++++++++++++++++++--
 1 file changed, 19 insertions(+), 2 deletions(-)

diff --git a/net-analyzer/arpwatch/arpwatch-2.1.15-r10.ebuild b/net-analyzer/arpwatch/arpwatch-2.1.15-r11.ebuild
similarity index 69%
rename from net-analyzer/arpwatch/arpwatch-2.1.15-r10.ebuild
rename to net-analyzer/arpwatch/arpwatch-2.1.15-r11.ebuild
index 986da0386f7..758ebf7b054 100644
--- a/net-analyzer/arpwatch/arpwatch-2.1.15-r10.ebuild
+++ b/net-analyzer/arpwatch/arpwatch-2.1.15-r11.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2017 Gentoo Foundation
+# Copyright 1999-2018 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=6
@@ -61,9 +61,26 @@ src_install () {
 	doins duplicates.awk euppertolower.awk p.awk e.awk d.awk
 
 	diropts --group=arpwatch --mode=770
-	dodir /var/lib/arpwatch
+	keepdir /var/lib/arpwatch
 	dodoc README CHANGES
 
 	newinitd "${FILESDIR}"/arpwatch.initd-r1 arpwatch
 	newconfd "${FILESDIR}"/arpwatch.confd-r1 arpwatch
 }
+
+pkg_postinst() {
+	# Previous revisions installed /var/lib/arpwatch with the wrong
+	# ownership. Instead of the intended arpwatch:root, it was left as
+	# root:root. If we find any such mis-owned directories, we fix them,
+	# and then set the permission bits how we want them in *this*
+	# revision.
+	#
+	# The "--from" flag ensures that we only fix directories that need
+	# fixing, and the "&& chmod" ensures that we only adjust the
+	# permissions if the owner also needed fixing.
+	chown --from=root:root \
+		  --no-dereference \
+		  :arpwatch \
+		  "${ROOT}"/var/lib/arpwatch && \
+		chmod 770 "${ROOT}"/var/lib/arpwatch
+}