This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: cvs diff howto?
On Mon, Aug 26, 2002 at 10:57:07PM +0200, Svein E. Seldal wrote:
> Daniel Jacobowitz wrote:
> >Generally, if you use 'cvs add' and then cvs diff (or maybe cvs diff
> >-N? I don't remember), this works. However, you might need to have
> >commit access to do it that way; CVS is awkward about that. I have a
> >little script that just looks for the "? Filename" lines and replaces
> >them with the appropriate diff.
> >
>
> My problem is that I do not have write access to the CVS so I cant add
> the new files, hence I cannot use cvs diff for these files.
>
> What would be the simplest way for me to submit such patches that
> contains both modified and new files? I'm tempted to submit an ordinary
> patch for the modified files and a tgz for the new ones. Will that do?
Please don't; instead, you can use such a script, or add dummy entries
to CVS/Entries by hand. They look like:
/filename/0/Initial filename//
> This script you were talking about sounds interesting. Would it be
> possble to get it?
It's pretty trivial. Here it is, usage "fillpatch <patchfilename>":
#!/usr/bin/perl
use strict;
my $file = shift @ARGV;
my $newfile = $file . ".new";
open (FILE, $file);
open (OUT, "> $newfile");
while (<FILE>)
{
if (/^\? (.*)$/) {
print OUT "Index: $1\n";
print OUT "===================================================================\n";
print OUT "RCS file: N/A\n";
print OUT "diff -u /dev/null $1\n";
close OUT;
system ("diff -u /dev/null \"$1\" >> $newfile");
open (OUT, ">> $newfile");
} else {
print OUT $_;
}
}
close OUT;
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer