From f9c367e4109d1a4cea8e8269535b6a8f10b5db48 Mon Sep 17 00:00:00 2001 From: Bertrand Jacquin Date: Fri, 10 Feb 2017 22:05:35 +0000 Subject: sys-fs/static-dev: Sync with upstream Package-Manager: portage-2.3.3 --- sys-fs/static-dev/static-dev-0.1.ebuild | 40 +++++++++++++++------------------ 1 file changed, 18 insertions(+), 22 deletions(-) (limited to 'sys-fs') diff --git a/sys-fs/static-dev/static-dev-0.1.ebuild b/sys-fs/static-dev/static-dev-0.1.ebuild index 77d49a9b..0ec2c55e 100644 --- a/sys-fs/static-dev/static-dev-0.1.ebuild +++ b/sys-fs/static-dev/static-dev-0.1.ebuild @@ -1,4 +1,4 @@ -# Copyright 1999-2016 Gentoo Foundation +# Copyright 1999-2017 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Id$ @@ -6,7 +6,7 @@ EAPI=6 inherit toolchain-funcs DESCRIPTION="A skeleton, statically managed /dev" -HOMEPAGE="http://bugs.gentoo.org/107875" +HOMEPAGE="https://bugs.gentoo.org/107875" SRC_URI="" LICENSE="GPL-2" @@ -14,26 +14,22 @@ SLOT="0" KEYWORDS="alpha amd64 arm hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86" IUSE="" -DEPEND="sys-apps/makedev" -RDEPEND="${DEPEND}" - -pkg_preinst() { - if [[ -d "${EROOT}/dev/.udev" || -c "${EROOT}/dev/.devfs" ]] ; then - echo "" - eerror "We have detected that you currently use udev or devfs" - eerror "and this ebuild cannot install to the same mount-point." - eerror "Please reinstall the ebuild (as root) like follows:" - eerror "" - eerror "mkdir /tmp/newroot" - eerror "mount -o bind / /tmp/newroot" - eerror "EROOT=/tmp/newroot/ emerge sys-fs/static-dev" - eerror "umount /tmp/newroot" - die "Cannot install on udev/devfs tmpfs." - fi +RDEPEND="sys-apps/makedev" +DEPEND="${RDEPEND}" + +abort() { + echo + eerror "We have detected that you currently use udev or devfs or devtmpfs" + eerror "and this ebuild cannot install to the same mount-point." + die "Cannot install on udev/devfs tmpfs." +} - einfo "" - einfo "To add personal devices classes, set env variable EXTRA_CLASSES" - einfo "" +pkg_pretend() { + # We also want to not clobber newer devtmpfs setups. + if [[ ${ROOT} == "/" ]] && \ + ! awk '$2 == "/dev" && $3 == "devtmpfs" { exit 1 }' /proc/mounts ; then + abort + fi } src_install() { @@ -44,7 +40,7 @@ src_install() { einfo "Creating device nodes using classes:" einfo " ${classes}" - [ -n "${EXTRA_CLASSES}" ] && einfo " ${EXTRA_CLASSES}" + [[ -n "${EXTRA_CLASSES}" ]] && einfo " ${EXTRA_CLASSES}" MAKEDEV -d "${ED}/dev" \ ${classes} \ -- cgit v1.2.3