summaryrefslogtreecommitdiff
path: root/net-dns/resolvconf-symlink
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /net-dns/resolvconf-symlink
reinit the tree, so we can have metadata
Diffstat (limited to 'net-dns/resolvconf-symlink')
-rw-r--r--net-dns/resolvconf-symlink/Manifest4
-rw-r--r--net-dns/resolvconf-symlink/metadata.xml12
-rw-r--r--net-dns/resolvconf-symlink/resolvconf-symlink-0.ebuild52
3 files changed, 68 insertions, 0 deletions
diff --git a/net-dns/resolvconf-symlink/Manifest b/net-dns/resolvconf-symlink/Manifest
new file mode 100644
index 000000000000..5d20d7b2ab9e
--- /dev/null
+++ b/net-dns/resolvconf-symlink/Manifest
@@ -0,0 +1,4 @@
+EBUILD resolvconf-symlink-0.ebuild 1496 SHA256 4d22efbc2141dc6b29ed70a945be5da6dc22549d4b0a59edd05d691bac077509 SHA512 8099ea0189da0e4614445d406c569e70ee1f88227803a5fcf42b6365a75224ac550f0af2a140c2d70db1f0bb2c49c0f85f6eb25314b161307829f99e552be889 WHIRLPOOL e44081ab10538722383c23f3643b6833019a75a16eaa5b58b15377167325d67f6a60279ea2ef96e5d0a26f3bcb076216b7d0beeb74f1d9cf5378a6ad0488ec2f
+MISC ChangeLog 2624 SHA256 00328fd3cb7410e338010ea767c3b3983ee337d7a3852d5691a7f870f656295b SHA512 37aed5d97e5f30ad17cc9f9fee3a80b6644d8011e5885a8832f048a6513dea128376a083f7a1656cf63c19a5c856e6a809d10c55e39673b7b62b466a8e57b70b WHIRLPOOL ea46ed9fde514b3240734a577e1df3968157070e0b44e856af0d5c4d6585e6b5a272a3b81d8d8fbef7f99b17e419f4cb5f33bdeae8cfb5a35ff25a649e8e9b1e
+MISC ChangeLog-2015 552 SHA256 a1059c3cba7440b50857cf040cb74e5b4914564a6536d8ab117674c5032e582b SHA512 58a1a6f41e80aed60d3604ea2c7dcae297a209fc61fd32a9ba0255bb23ea79d05738d341782148f2f82926b822437fd25322a8cef76d13ee9d7d9c655f7acfe5 WHIRLPOOL 1579c8ec7ae9f44cbd2c3fc586cf4938e0cc6bbc722502895ce2d9a292f5c2b97f57f0fed89c70c0e7488fa93d80aad45c65c7ba7944df950fdf3deae5b34c72
+MISC metadata.xml 387 SHA256 bca32353c836198378e0a4a3b3756b3d199ffe3862e268a7f24172cccc78f6f4 SHA512 34bb7374a90375f557a9791c7b7cfb78260965a148e6c73ef829bbd2dbc34931b7677408e519e7cdb06445c0ac3ea180b59e73770614e6215eddf15fcdbaf064 WHIRLPOOL 91d3e4be9dba19461fec843a567da6892714e35c44aac9b61d6de15bbade70ccaa260b7db7b8b8c7557bdbf9a95c61573b21debf465e642e4dfa44936aa6b5da
diff --git a/net-dns/resolvconf-symlink/metadata.xml b/net-dns/resolvconf-symlink/metadata.xml
new file mode 100644
index 000000000000..91f7b275a878
--- /dev/null
+++ b/net-dns/resolvconf-symlink/metadata.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>mgorny@gentoo.org</email>
+ <name>Michał Górny</name>
+ </maintainer>
+ <use>
+ <flag name="symlink">Actually replace /etc/resolv.conf with a
+ symlink. Without this flag, the ebuild is a no-op.</flag>
+ </use>
+</pkgmetadata>
diff --git a/net-dns/resolvconf-symlink/resolvconf-symlink-0.ebuild b/net-dns/resolvconf-symlink/resolvconf-symlink-0.ebuild
new file mode 100644
index 000000000000..d11ff4ab6257
--- /dev/null
+++ b/net-dns/resolvconf-symlink/resolvconf-symlink-0.ebuild
@@ -0,0 +1,52 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=4
+
+DESCRIPTION="Make /etc/resolv.conf a symlink to a runtime-writable location"
+HOMEPAGE="https://www.gentoo.org"
+SRC_URI=""
+
+LICENSE="public-domain"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="+symlink"
+
+S=${WORKDIR}
+
+pkg_preinst() {
+ if use symlink; then
+ if [[ -f "${ROOT}"etc/resolv.conf && ! -L "${ROOT}"etc/resolv.conf ]]
+ then # migrate existing resolv.conf
+ if [[ "$(head -n 1 "${ROOT}"etc/resolv.conf)" \
+ != "# Generated by "* ]]; then
+
+ eerror "${ROOT}etc/resolv.conf seems not to be autogenerated."
+ eerror "Aborting build to avoid removing user data. If that file is supposed"
+ eerror "to be autogenerated, please remove it manually. Otherwise, please"
+ eerror "set USE=-symlink to avoid installing resolv.conf symlink."
+
+ die "${ROOT}etc/resolv.conf not autogenerated"
+ else
+ ebegin "Moving ${ROOT}etc/resolv.conf to ${ROOT}var/run/"
+ mv "${ROOT}"etc/resolv.conf "${ROOT}"var/run/
+ eend ${?} || die
+ fi
+ fi
+ fi
+}
+
+src_install() {
+ # XXX: /run should be more correct, when it's supported by baselayout
+
+ use symlink && dosym /var/run/resolv.conf /etc/resolv.conf
+}
+
+pkg_postrm() {
+ # Don't leave the user with no resolv.conf
+ if [[ ! -e "${ROOT}"etc/resolv.conf && -f "${ROOT}"var/run/resolv.conf ]]; then
+ ebegin "Moving ${ROOT}var/run/resolv.conf to ${ROOT}etc/"
+ mv "${ROOT}"var/run/resolv.conf "${ROOT}"etc/
+ eend ${?} || die
+ fi
+}