This is the mail archive of the
cygwin-developers@sources.redhat.com
mailing list for the Cygwin project.
Re: Silly Patch Question
- To: Jason dot Tishler at dothill dot com
- Subject: Re: Silly Patch Question
- From: DJ Delorie <dj at delorie dot com>
- Date: Wed, 8 Nov 2000 12:34:57 -0500
- CC: cygwin-developers at sources dot redhat dot com
- References: <20001108085927.D388@dothill.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;
}