diff options
author | 2011-08-22 08:37:26 +0000 | |
---|---|---|
committer | 2011-08-22 08:37:26 +0000 | |
commit | b088e965050b89ad0806f0b16c497173237aa166 (patch) | |
tree | 72d40beee5f75373abcbe4bb59ef22539e687b21 /net-dns/resolvconf-symlink | |
parent | Version bump. (diff) | |
download | historical-b088e965050b89ad0806f0b16c497173237aa166.tar.gz historical-b088e965050b89ad0806f0b16c497173237aa166.tar.bz2 historical-b088e965050b89ad0806f0b16c497173237aa166.zip |
Introduce the ebuild for making /etc/resolv.conf a symlink.
Package-Manager: portage-2.2.0_alpha51_p4/cvs/Linux x86_64
Diffstat (limited to 'net-dns/resolvconf-symlink')
-rw-r--r-- | net-dns/resolvconf-symlink/ChangeLog | 10 | ||||
-rw-r--r-- | net-dns/resolvconf-symlink/Manifest | 15 | ||||
-rw-r--r-- | net-dns/resolvconf-symlink/metadata.xml | 13 | ||||
-rw-r--r-- | net-dns/resolvconf-symlink/resolvconf-symlink-0.ebuild | 53 |
4 files changed, 91 insertions, 0 deletions
diff --git a/net-dns/resolvconf-symlink/ChangeLog b/net-dns/resolvconf-symlink/ChangeLog new file mode 100644 index 000000000000..56077754d51d --- /dev/null +++ b/net-dns/resolvconf-symlink/ChangeLog @@ -0,0 +1,10 @@ +# ChangeLog for net-dns/resolvconf-symlink +# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/net-dns/resolvconf-symlink/ChangeLog,v 1.1 2011/08/22 08:37:26 mgorny Exp $ + +*resolvconf-symlink-0 (22 Aug 2011) + + 22 Aug 2011; Michał Górny <mgorny@gentoo.org> +resolvconf-symlink-0.ebuild, + +metadata.xml: + Introduce the ebuild for making /etc/resolv.conf a symlink. + diff --git a/net-dns/resolvconf-symlink/Manifest b/net-dns/resolvconf-symlink/Manifest new file mode 100644 index 000000000000..514087ea69f5 --- /dev/null +++ b/net-dns/resolvconf-symlink/Manifest @@ -0,0 +1,15 @@ +-----BEGIN PGP SIGNED MESSAGE----- +Hash: SHA256 + +EBUILD resolvconf-symlink-0.ebuild 1616 RMD160 bfa1736ed20b9d45af2a18ebddd1b27d093918c5 SHA1 b1c7c14df605a2b0ad1b1d9c3843e822843c5dfe SHA256 6017b06e51969d51aa4a243d140d4c81ab953a51cb485be9132138177e9c1f3d +MISC ChangeLog 422 RMD160 d4d031d7fa21cb856595ebe9eab8dc0a3c81417e SHA1 02673d29ff14ce5bfe6ae0929c708c0457b86432 SHA256 14509c57f84e4c586eff5510cf30f01dd7310eeaa47b8d5489c2a123bd5e11a9 +MISC metadata.xml 395 RMD160 be9a9b3167852a0198233a9cf80ef4c3e3e19a51 SHA1 e93c6ba6440815d8e65fe5a9eddcb206afe4e0ea SHA256 2876dd61fcf22fbae4ab4cdea0ffa38e8c36e0c7430cb828c3672fdd878179c8 +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v2.0.18 (GNU/Linux) + +iJwEAQEIAAYFAk5SFcEACgkQfXuS5UK5QB3E5AP9EWFNf0B4YA4tv1UxQK9AiztI +HLnaTEPphatCERE84xHCZWD7usATOFgyxWugLA/C4bjWrFnf6K/Slj3tkM/H90mJ +lu3t4z31wtTI3VVKn3QbBx2XIRHpg/gDYsWEZk+/zPFRrvwXVItlniCZk5JbWDN6 +EuvuOiX3BAlcEtEGrIs= +=MabL +-----END PGP SIGNATURE----- diff --git a/net-dns/resolvconf-symlink/metadata.xml b/net-dns/resolvconf-symlink/metadata.xml new file mode 100644 index 000000000000..2e823effb84a --- /dev/null +++ b/net-dns/resolvconf-symlink/metadata.xml @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <herd>no-herd</herd> + <maintainer> + <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..9670b0aee61e --- /dev/null +++ b/net-dns/resolvconf-symlink/resolvconf-symlink-0.ebuild @@ -0,0 +1,53 @@ +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-dns/resolvconf-symlink/resolvconf-symlink-0.ebuild,v 1.1 2011/08/22 08:37:26 mgorny Exp $ + +EAPI=4 + +DESCRIPTION="Make /etc/resolv.conf a symlink to a runtime-writable location" +HOMEPAGE="http://www.gentoo.org" +SRC_URI="" + +LICENSE="as-is" +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 +} |