summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2011-09-22 19:38:41 +0000
committerMike Frysinger <vapier@gentoo.org>2011-09-22 19:38:41 +0000
commitae11ea455d624cf19256f137333bed14732731f6 (patch)
tree5f49ba087206c186ab0bca90a0fc79118d0c3fae /net-misc/dhcp/dhcp-4.2.2-r2.ebuild
parentVersion bump. (diff)
downloadgentoo-2-ae11ea455d624cf19256f137333bed14732731f6.tar.gz
gentoo-2-ae11ea455d624cf19256f137333bed14732731f6.tar.bz2
gentoo-2-ae11ea455d624cf19256f137333bed14732731f6.zip
Install the default config files commented out since they aren't useful in the real world other than as examples #384087 by Nick Bowler.
(Portage version: 2.2.0_alpha59/cvs/Linux x86_64)
Diffstat (limited to 'net-misc/dhcp/dhcp-4.2.2-r2.ebuild')
-rw-r--r--net-misc/dhcp/dhcp-4.2.2-r2.ebuild20
1 files changed, 14 insertions, 6 deletions
diff --git a/net-misc/dhcp/dhcp-4.2.2-r2.ebuild b/net-misc/dhcp/dhcp-4.2.2-r2.ebuild
index 02634b1ad3be..846ea9f575bb 100644
--- a/net-misc/dhcp/dhcp-4.2.2-r2.ebuild
+++ b/net-misc/dhcp/dhcp-4.2.2-r2.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/net-misc/dhcp/dhcp-4.2.2-r2.ebuild,v 1.4 2011/09/22 17:32:35 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-misc/dhcp/dhcp-4.2.2-r2.ebuild,v 1.5 2011/09/22 19:38:41 vapier Exp $
EAPI="2"
@@ -198,18 +198,26 @@ src_install() {
newinitd "${FILESDIR}"/dhcrelay.init2 dhcrelay || die
newconfd "${FILESDIR}"/dhcrelay.conf dhcrelay || die
fi
+
+ # the default config files aren't terribly useful #384087
+ sed -i '/^[^#]/s:^:#:' "${D}"/etc/dhcp/*.conf || die
}
pkg_preinst() {
enewgroup dhcp
enewuser dhcp -1 -1 /var/lib/dhcp dhcp
- # Keep the user files over the sample ones
- local f
- for f in dhclient dhcpd ; do
- f="/etc/dhcp/${f}.conf"
+ # Keep the user files over the sample ones. The
+ # hashing is to ignore the crappy defaults #384087.
+ local f h
+ for f in dhclient:da7c8496a96452190aecf9afceef4510 dhcpd:10979e7b71134bd7f04d2a60bd58f070 ; do
+ h=${f#*:}
+ f="/etc/dhcp/${f%:*}.conf"
if [ -e "${ROOT}"${f} ] ; then
- cp -p "${ROOT}"${f} "${D}"${f}
+ case $(md5sum "${ROOT}"${f}) in
+ ${h}*) ;;
+ *) cp -p "${ROOT}"${f} "${D}"${f};;
+ esac
fi
done
}