-# Copyright 1999-2014 Gentoo Foundation
+# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
+EAPI="5"
+
DESCRIPTION="A skeleton, statically managed /dev"
HOMEPAGE="https://bugs.gentoo.org/107875"
SRC_URI=""
IUSE=""
RDEPEND="sys-apps/makedev"
+DEPEND="${RDEPEND}"
abort() {
echo
die "Cannot install on udev/devfs tmpfs."
}
-pkg_preinst() {
+pkg_pretend() {
+ if [[ ${MERGE_TYPE} == "buildonly" ]] ; then
+ # User is just compiling which is fine -- all our checks are merge-time.
+ return
+ fi
+
+ # We want to not clobber udev (tmpfs) or older devfs setups.
if [[ -d ${ROOT}/dev/.udev || -c ${ROOT}/dev/.devfs ]] ; then
abort
fi
+ # We also want to not clobber newer devtmpfs setups.
if [[ ${ROOT} == "/" ]] && \
! awk '$2 == "/dev" && $3 == "devtmpfs" { exit 1 }' /proc/mounts ; then
abort