From 38b52d4bbd96d633b7e3ca727feb7817d0dd8892 Mon Sep 17 00:00:00 2001 From: Alex Badea Date: Fri, 12 Apr 2002 13:00:35 +0000 Subject: [PATCH] Author: Alex Badea Log message: ircd-patch: report files which failed the dry run git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/trunk@730 c9e4aea6-c8fd-4c43-8297-357d70d61c8c --- ChangeLog | 6 ++++++ ircd-patch | 9 +++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5ebf9aa..f5af491 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2002-04-12 Alex Badea + + * ircd-patch: report which files failed the dry run (so the + user may force the patch if the rejects are in less-than-vital + files, such as ChangeLog or documentation) + 2002-04-12 Alex Badea * ircd/m_invite.c: don't propagate invites for local channels diff --git a/ircd-patch b/ircd-patch index 560b1d6..cdfe53a 100755 --- a/ircd-patch +++ b/ircd-patch @@ -17,7 +17,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # -# $Id: ircd-patch,v 1.4 2002-04-09 22:40:56 vampire Exp $ +# $Id: ircd-patch,v 1.5 2002-04-12 13:00:35 vampire Exp $ # # # Experimental centralized patch system for ircu @@ -59,7 +59,8 @@ update_patchlist() { [ ! -d $MARKS ] && (echo "*** Missing $MARKS, creating it" ; mkdir -p $MARKS) dry_run() { - patch -p0 -N -t --dry-run $2 >/dev/null < $1 + rejects=`patch -p0 -N -t --dry-run $2 < $1 | grep "hunk FAILED" | sed -e 's/.*to file / /;s/\.rej$//'` + test -z "$rejects" } patch_list() { @@ -118,6 +119,8 @@ patch_add() { echo -n "Testing $fname... " if ! dry_run $fname ; then echo "Failed (use -f to force)." + echo "The following files failed patching:" + echo "$rejects" retcode=2 return fi @@ -153,6 +156,8 @@ patch_del() { echo -n "Testing $fname... " if ! dry_run $fname -R ; then echo "Failed (use -f to force)." + echo "The following files failed patching:" + echo "$rejects" retcode=2 return fi -- 2.20.1