Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-dns/resolvconf-symlink/
Date: Fri, 03 Jan 2020 20:40:24
Message-Id: 1578083986.3dd9591c26a2d8d03b2e1bd8c56e1958eb3fba19.mgorny@gentoo
1 commit: 3dd9591c26a2d8d03b2e1bd8c56e1958eb3fba19
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Fri Jan 3 16:51:28 2020 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Fri Jan 3 20:39:46 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3dd9591c
7
8 net-dns/resolvconf-symlink: Bump to EAPI=7
9
10 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
11
12 .../resolvconf-symlink/resolvconf-symlink-0.ebuild | 24 +++++++++++-----------
13 1 file changed, 12 insertions(+), 12 deletions(-)
14
15 diff --git a/net-dns/resolvconf-symlink/resolvconf-symlink-0.ebuild b/net-dns/resolvconf-symlink/resolvconf-symlink-0.ebuild
16 index f7ad0c45626..dbf2b430fba 100644
17 --- a/net-dns/resolvconf-symlink/resolvconf-symlink-0.ebuild
18 +++ b/net-dns/resolvconf-symlink/resolvconf-symlink-0.ebuild
19 @@ -1,35 +1,34 @@
20 # Copyright 1999-2020 Gentoo Authors
21 # Distributed under the terms of the GNU General Public License v2
22
23 -EAPI=4
24 +EAPI=7
25
26 DESCRIPTION="Make /etc/resolv.conf a symlink to a runtime-writable location"
27 HOMEPAGE="https://wiki.gentoo.org/wiki/No_homepage"
28 SRC_URI=""
29 +S=${WORKDIR}
30
31 LICENSE="public-domain"
32 SLOT="0"
33 KEYWORDS="~amd64 ~x86"
34 IUSE="+symlink"
35
36 -S=${WORKDIR}
37 -
38 pkg_preinst() {
39 if use symlink; then
40 - if [[ -f "${ROOT}"etc/resolv.conf && ! -L "${ROOT}"etc/resolv.conf ]]
41 + if [[ -f ${EROOT}/etc/resolv.conf && ! -L ${EROOT}/etc/resolv.conf ]]
42 then # migrate existing resolv.conf
43 - if [[ "$(head -n 1 "${ROOT}"etc/resolv.conf)" \
44 + if [[ "$(head -n 1 "${EROOT}"/etc/resolv.conf)" \
45 != "# Generated by "* ]]; then
46
47 - eerror "${ROOT}etc/resolv.conf seems not to be autogenerated."
48 + eerror "${EROOT}/etc/resolv.conf seems not to be autogenerated."
49 eerror "Aborting build to avoid removing user data. If that file is supposed"
50 eerror "to be autogenerated, please remove it manually. Otherwise, please"
51 eerror "set USE=-symlink to avoid installing resolv.conf symlink."
52
53 - die "${ROOT}etc/resolv.conf not autogenerated"
54 + die "${EROOT}/etc/resolv.conf not autogenerated"
55 else
56 - ebegin "Moving ${ROOT}etc/resolv.conf to ${ROOT}var/run/"
57 - mv "${ROOT}"etc/resolv.conf "${ROOT}"var/run/
58 + ebegin "Moving ${EROOT}/etc/resolv.conf to ${EROOT}/var/run/"
59 + mv "${EROOT}"/etc/resolv.conf "${EROOT}"/var/run/
60 eend ${?} || die
61 fi
62 fi
63 @@ -44,9 +43,10 @@ src_install() {
64
65 pkg_postrm() {
66 # Don't leave the user with no resolv.conf
67 - if [[ ! -e "${ROOT}"etc/resolv.conf && -f "${ROOT}"var/run/resolv.conf ]]; then
68 - ebegin "Moving ${ROOT}var/run/resolv.conf to ${ROOT}etc/"
69 - mv "${ROOT}"var/run/resolv.conf "${ROOT}"etc/
70 + if [[ ! -e ${EROOT}/etc/resolv.conf && -f ${EROOT}/var/run/resolv.conf ]]
71 + then
72 + ebegin "Moving ${EROOT}/var/run/resolv.conf to ${EROOT}/etc/"
73 + mv "${EROOT}"/var/run/resolv.conf "${EROOT}"/etc/
74 eend ${?} || die
75 fi
76 }