delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin-developers/2000/11/08/12:56:37

Mailing-List: contact cygwin-developers-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-developers-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin-developers/>
List-Post: <mailto:cygwin-developers AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-developers-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-developers-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin-developers AT sources DOT redhat DOT com
Date: Wed, 8 Nov 2000 12:34:57 -0500
Message-Id: <200011081734.MAA23244@envy.delorie.com>
X-Authentication-Warning: envy.delorie.com: dj set sender to dj AT envy DOT delorie DOT com using -f
From: DJ Delorie <dj AT delorie DOT com>
To: Jason DOT Tishler AT dothill DOT com
CC: cygwin-developers AT sources DOT redhat DOT com
In-reply-to: <20001108085927.D388@dothill.com> (message from Jason Tishler on
Wed, 8 Nov 2000 08:59:27 -0500)
Subject: Re: Silly Patch Question
References: <20001108085927 DOT D388 AT dothill DOT com>

You might need the "-p0" option of patch, otherwise it strips off
directory names.

Plus, "cvs diff" strips directory names too.  I have a script
that puts them back on.  Do "cvs diff -p2 ... | FixPatch > file.txt"

#!/usr/bin/perl
# -*- perl -*-

while (<>) {
    s/\r//;
    if (/^Index: (\S+)/) {
	$full = $1;
    }
    if (/^(diff .* )\S+/) {
	$_ = "$1 $full\n";
	$header = 1;
    }
    if ($header) {
	$header = 0 if /\*\*\*\*/;
	s/^--- \S+/--- $full/;
	s/^\+\+\+ \S+/\+\+\+ $full/;
	s/^\*\*\* \S+/\*\*\* $full/;
    }

    print;

}

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019