rpms/ifplugd/devel ifplugd_action-readability.patch, NONE, 1.1 ifplugd.spec, 1.22, 1.23

José Abílio Oliveira Matos jamatos at fedoraproject.org
Mon May 31 16:06:52 UTC 2010


Author: jamatos

Update of /cvs/pkgs/rpms/ifplugd/devel
In directory cvs01.phx2.fedoraproject.org:/tmp/cvs-serv24971

Modified Files:
	ifplugd.spec 
Added Files:
	ifplugd_action-readability.patch 
Log Message:
* Mon May 31 2010 José Matos <jamatos at fc.up.pt> - 0.28-15
- Add action readability patch (thanks to Niels de Vos) (bz#597866)


ifplugd_action-readability.patch:
 ifplugd.action |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

--- NEW FILE ifplugd_action-readability.patch ---
improve readability of ifplugd.action

$1 and $2 are easily mistaken and are not documented in the header
of the file. Assigning clear variable names improved readability and
makes it easier to change the script.

Signed-off-by: Niels de Vos <ndevos at redhat.com>
--- conf/ifplugd.action.orig	2010-05-30 21:12:30.251833801 +0100
+++ conf/ifplugd.action	2010-05-30 21:14:11.601958801 +0100
@@ -19,12 +19,15 @@
 
 set -e
 
-if [ -z "$1" ] || [ -z "$2" ] ; then
+NETDEV="$1"
+ACTION="$2"
+
+if [ -z "$NETDEV" ] || [ -z "$ACTION" ] ; then
 	echo "Wrong arguments" > /dev/stderr
 	exit 1
 fi
 
-[ "$2" = "up" ] && exec /sbin/ifup $1
-[ "$2" = "down" ] && exec /sbin/ifdown $1
+[ "$ACTION" = "up" ] && exec /sbin/ifup "$NETDEV"
+[ "$ACTION" = "down" ] && exec /sbin/ifdown "$NETDEV"
 
 exit 1


Index: ifplugd.spec
===================================================================
RCS file: /cvs/pkgs/rpms/ifplugd/devel/ifplugd.spec,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -p -r1.22 -r1.23
--- ifplugd.spec	30 Jul 2009 21:50:11 -0000	1.22
+++ ifplugd.spec	31 May 2010 16:06:51 -0000	1.23
@@ -1,13 +1,14 @@
 Summary:       Detect and take action when an ethernet cable is unplugged
 Name:          ifplugd
 Version:       0.28
-Release:       14%{?dist}
+Release:       15%{?dist}
 
 License:       GPLv2+
 Group:         System Environment/Daemons
 URL:           http://0pointer.de/lennart/projects/ifplugd
 Source0:       http://0pointer.de/lennart/projects/ifplugd/%{name}-%{version}.tar.gz
 Patch0:        interface_c.patch
+Patch1:        ifplugd_action-readability.patch
 BuildRoot:     %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 Requires:      libdaemon
 BuildRequires: libdaemon-devel, pkgconfig
@@ -22,6 +23,7 @@ when a cable is really connected.
 %prep
 %setup -q
 %patch0 -p1
+%patch1 -p0
 
 %build
 %configure --prefix=/ --disable-lynx --disable-xmltoman --disable-subversion --with-initdir=%{_initrddir}
@@ -59,6 +61,9 @@ rm -rf $RPM_BUILD_ROOT
 /sbin/chkconfig --del ifplugd
 
 %changelog
+* Mon May 31 2010 José Matos <jamatos at fc.up.pt> - 0.28-15
+- Add action readability patch (thanks to Niels de Vos) (bz#597866)
+
 * Thu Jul 30 2009 Jesse Keating <jkeating at redhat.com> - 0.28-14
 - Rebuild for F12 mass rebuild
 



More information about the scm-commits mailing list