From owner-freebsd-ports Sun Sep 26 14:17: 6 1999 Delivered-To: freebsd-ports@freebsd.org Received: from mail-blue.research.att.com (mail-blue.research.att.com [135.207.30.102]) by hub.freebsd.org (Postfix) with ESMTP id E5C5F15720 for ; Sun, 26 Sep 1999 14:16:07 -0700 (PDT) (envelope-from fenner@research.att.com) Received: from alliance.research.att.com (alliance.research.att.com [135.207.26.26]) by mail-blue.research.att.com (Postfix) with ESMTP id F3C784CE17; Sun, 26 Sep 1999 17:16:06 -0400 (EDT) Received: from windsor.research.att.com (windsor.research.att.com [135.207.26.46]) by alliance.research.att.com (8.8.7/8.8.7) with ESMTP id RAA22995; Sun, 26 Sep 1999 17:16:06 -0400 (EDT) From: Bill Fenner Received: (from fenner@localhost) by windsor.research.att.com (8.8.8+Sun/8.8.5) id OAA28655; Sun, 26 Sep 1999 14:16:06 -0700 (PDT) Message-Id: <199909262116.OAA28655@windsor.research.att.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary=19701020; charset=US-ASCII To: billf@jade.chc-chimes.com Subject: Re: Help with RCS files, patches, and PR's required. Cc: ports@freebsd.org Date: Sun, 26 Sep 1999 14:16:05 -0700 Versions: dmail (solaris) 2.2e/makemail 2.8u Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org --19701020 Content-Type: text/plain; charset=US-ASCII Content-Disposition: inline >I know I prefer unified (to the point that I skip over non unified diffs) Or use my handy filter. Once I started using unidiff I stopped being able to read context diffs. It works on many but not all context diffs I've thrown at it. Bill --19701020 Content-Type: application/x-perl; name="ctou"; x-unix-mode=0755 Content-Disposition: attachment; filename="ctou" #!/usr/common/bin/perl -s # # # ctou # 1 February 1999 # Bill Fenner # turn diff -c output into diff -u output. # # context: # *** FROM-FILE FROM-FILE-MODIFICATION-TIME # --- TO-FILE TO-FILE-MODIFICATION TIME # *************** # *** FROM-FILE-LINE-RANGE **** # FROM-FILE-LINE # FROM-FILE-LINE... # --- TO-FILE-LINE-RANGE ---- # TO-FILE-LINE # TO-FILE-LINE... # # Note that if there were no removals/changes, FROM-FILE-LINE section can be # empty, and if there were no additions/changes, TO-FILE-LINE section can be # empty. # # uni: # --- FROM-FILE FROM-FILE-MODIFICATION-TIME # +++ TO-FILE TO-FILE-MODIFICATION-TIME # @@ FROM-FILE-RANGE TO-FILE-RANGE @@ # LINE-FROM-EITHER-FILE # LINE-FROM-EITHER-FILE... # # $in = 0; while (<>) { chop; print ($in,">",$_,"\n") if ($d); if (/^\*\*\*\s+(\S+)\s+\*\*\*\*$/) { $fromrange = $1; @from = (); $in = 1; next; } if (/^---\s+(\S+)\s+----$/) { $torange = $1; @to = (); $in = 2; next; } if (/^[^-+! ]/) { if ($in != 0) { &handleit; $in = 0; } } if ($in == 0) { if (/^\*\*\*(\s+.*)/) { print "---$1\n"; } elsif (/^---(\s+.*)/) { print "+++$1\n"; } elsif (/^\*\*\*\*\*/) { # part of context diff header } else { print $_, "\n"; } } elsif ($in == 1) { push(@from, $_); } elsif ($in == 2) { push(@to, $_); } else { die "in is $in!\n"; } } if ($in != 0) { &handleit; } sub handleit { local($fromline, $toline) = ($[, $[); local($fromstart, $fromend) = split(/,/, $fromrange); local($tostart, $toend) = split(/,/, $torange); print "@@ -", $fromstart, ",", $fromend - $fromstart + 1; print " +", $tostart, ",", $toend - $tostart + 1, " @@\n"; while ($fromline <= $#from || $toline <= $#to) { if ($fromline > $#from) { ($fchar, $f) = ("X", undef); } else { ($fchar, $f) = ($from[$fromline] =~ /^(.)\s(.*)/); } if ($toline > $#to) { ($tchar, $t) = ("X", undef); } else { ($tchar, $t) = ($to[$toline] =~ /^(.)\s(.*)/); } if ($fchar eq "!") { print "-", $f, "\n"; $fromline++; next; } if ($tchar eq "!") { print "+", $t, "\n"; $toline++; next; } if ($fchar eq "-") { print $fchar, $f, "\n"; $fromline++; next; } if ($tchar eq "+") { print $tchar, $t, "\n"; $toline++; next; } if ($fchar eq " ") { print " ",$f,"\n"; $fromline++; $toline++; next; } if ($tchar eq " ") { print " ",$t,"\n"; $fromline++; $toline++; next; } die "fchar is $fchar, tchar is $tchar, gonna loop!"; } } --19701020-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message