packages: dhcp/dhcp-dhclient-script, dhcp/dhcp.spec - /etc/dhclient-{enter, ...
jajcus
jajcus at pld-linux.org
Sun May 2 15:21:21 CEST 2010
Author: jajcus Date: Sun May 2 13:21:21 2010 GMT
Module: packages Tag: HEAD
---- Log message:
- /etc/dhclient-{enter,exit}-hooks.d/ dirs for easier plugging-in
- client: S: avahi-autoipd (provides IPV4all-providing hooks for dhclient)
- Release: 2
---- Files affected:
packages/dhcp:
dhcp-dhclient-script (1.2 -> 1.3) , dhcp.spec (1.176 -> 1.177)
---- Diffs:
================================================================
Index: packages/dhcp/dhcp-dhclient-script
diff -u packages/dhcp/dhcp-dhclient-script:1.2 packages/dhcp/dhcp-dhclient-script:1.3
--- packages/dhcp/dhcp-dhclient-script:1.2 Thu May 1 16:05:30 2008
+++ packages/dhcp/dhcp-dhclient-script Sun May 2 15:21:15 2010
@@ -82,24 +82,38 @@
# Invokes the local dhcp client exit hooks, if any.
exit_with_hooks() {
exit_status=$1
- if [ -f /etc/dhclient-exit-hooks ]; then
- . /etc/dhclient-exit-hooks
- fi
+
+ for i in /etc/dhclient-exit-hooks.d/*[!~,] ; do
+ [ -f "$i" ] || continue
+ # Don't run *.{rpmsave,rpmorig,rpmnew,swp} scripts
+ [ "${i%.rpmsave}" != "${i}" ] && continue
+ [ "${i%.rpmorig}" != "${i}" ] && continue
+ [ "${i%.rpmnew}" != "${i}" ] && continue
+ [ "${i%.swp}" != "${i}" ] && continue
+ [ "${i%,v}" != "${i}" ] && continue
+
+ . ${i}
+ done
# probably should do something with exit status of the local script
exit $exit_status
}
+exit_status=0
+for i in /etc/dhclient-enter-hooks.d/*[!~,] ; do
+ [ -f "$i" ] || continue
+ # Don't run *.{rpmsave,rpmorig,rpmnew,swp} scripts
+ [ "${i%.rpmsave}" != "${i}" ] && continue
+ [ "${i%.rpmorig}" != "${i}" ] && continue
+ [ "${i%.rpmnew}" != "${i}" ] && continue
+ [ "${i%.swp}" != "${i}" ] && continue
+ [ "${i%,v}" != "${i}" ] && continue
-# Invoke the local dhcp client enter hooks, if they exist.
-if [ -f /etc/dhclient-enter-hooks ]; then
- exit_status=0
- . /etc/dhclient-enter-hooks
- # allow the local script to abort processing of this state
- # local script must set exit_status variable to nonzero.
+ . ${i}
+
if [ $exit_status -ne 0 ]; then
exit $exit_status
fi
-fi
+done
###
### DHCPv4 Handlers
================================================================
Index: packages/dhcp/dhcp.spec
diff -u packages/dhcp/dhcp.spec:1.176 packages/dhcp/dhcp.spec:1.177
--- packages/dhcp/dhcp.spec:1.176 Tue Apr 27 12:40:42 2010
+++ packages/dhcp/dhcp.spec Sun May 2 15:21:16 2010
@@ -14,7 +14,7 @@
Name: dhcp
# 4.1.0a1 is on DEVEL
Version: 4.0.2
-Release: 1
+Release: 2
Epoch: 4
License: MIT
Group: Networking/Daemons
@@ -122,6 +122,7 @@
Requires: coreutils
Requires: iproute2
Requires: net-tools
+Suggests: avahi-autoipd
Obsoletes: dhclient
%description client
@@ -296,7 +297,7 @@
%install
rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT{/etc/{rc.d/init.d,sysconfig},%{_pkgconfigdir},/var/lib/{dhcpd,dhclient}}
+install -d $RPM_BUILD_ROOT{/etc/{rc.d/init.d,sysconfig,dhclient-enter-hooks.d,dhclient-exit-hooks.d},%{_pkgconfigdir},/var/lib/{dhcpd,dhclient}}
%{__make} install \
DESTDIR=$RPM_BUILD_ROOT
@@ -404,6 +405,14 @@
/sbin/chkconfig --del dhcp-relay
fi
+%triggerun client -- %{name}-client < 4:4.0.2-2
+if [ -f /etc/dhclient-enter-hooks ] ; then
+ mv /etc/dhclient-enter-hooks /etc/dhclient-enter-hooks.d/
+fi
+if [ -f /etc/dhclient-exit-hooks ] ; then
+ mv /etc/dhclient-exit-hooks /etc/dhclient-exit-hooks.d/
+fi
+
%post -n libdhcp4client -p /sbin/ldconfig
%postun -n libdhcp4client -p /sbin/ldconfig
@@ -431,6 +440,8 @@
%defattr(644,root,root,755)
%doc contrib/sethostname.sh client/dhclient.conf
%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/dhclient.conf
+%{_sysconfdir}/dhclient-enter-hooks.d
+%{_sysconfdir}/dhclient-exit-hooks.d
%attr(755,root,root) /sbin/dhclient
%attr(755,root,root) /sbin/dhclient-script
%{_mandir}/man5/dhclient.conf.5*
@@ -488,6 +499,11 @@
All persons listed below can be reached at <cvs_login>@pld-linux.org
$Log$
+Revision 1.177 2010/05/02 13:21:16 jajcus
+- /etc/dhclient-{enter,exit}-hooks.d/ dirs for easier plugging-in
+- client: S: avahi-autoipd (provides IPV4all-providing hooks for dhclient)
+- Release: 2
+
Revision 1.176 2010/04/27 10:40:42 arekm
- up to 4.0.2
================================================================
---- CVS-web:
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/dhcp/dhcp-dhclient-script?r1=1.2&r2=1.3&f=u
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/dhcp/dhcp.spec?r1=1.176&r2=1.177&f=u
More information about the pld-cvs-commit
mailing list