This is the mail archive of the cygwin-developers@sources.redhat.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Silly Patch Question



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;

}

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]