Author: Alex Badea <vampire@p16.pub.ro>
authorAlex Badea <vampire@p16.pub.ro>
Fri, 12 Apr 2002 13:00:35 +0000 (13:00 +0000)
committerAlex Badea <vampire@p16.pub.ro>
Fri, 12 Apr 2002 13:00:35 +0000 (13:00 +0000)
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
ircd-patch

index 5ebf9aaae2d62f4730408966aa06d3d85172c6f9..f5af4910e2598d3b0c7e50d61b84d683cd19c95a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2002-04-12  Alex Badea  <vampire@p16.pub.ro>
+
+       * 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  <vampire@p16.pub.ro>
 
        * ircd/m_invite.c: don't propagate invites for local channels
index 560b1d6056bda1e24093b58f11125ec386c4bcfa..cdfe53ae5e035283dd9d73d675b15274d9731b61 100755 (executable)
@@ -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