summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Orlitzky <mjo@gentoo.org>2018-01-09 15:54:39 -0500
committerMichael Orlitzky <mjo@gentoo.org>2018-01-09 15:56:35 -0500
commitb1bab70c44f772993901189cfe8eab4324db544e (patch)
treed303e1db8f63de35684d5c7956ce6db4052166de /net-analyzer
parentsys-libs/compiler-rt-sanitizers: Default to building using clang (diff)
downloadgentoo-b1bab70c44f772993901189cfe8eab4324db544e.tar.gz
gentoo-b1bab70c44f772993901189cfe8eab4324db544e.tar.bz2
gentoo-b1bab70c44f772993901189cfe8eab4324db544e.zip
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
Diffstat (limited to 'net-analyzer')
-rw-r--r--net-analyzer/arpwatch/arpwatch-2.1.15-r11.ebuild (renamed from net-analyzer/arpwatch/arpwatch-2.1.15-r10.ebuild)21
1 files 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
index 986da0386f7d..758ebf7b0548 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
+}