From a2c6387bcf04cf5542d4fb14b9aa2a097a31350e Mon Sep 17 00:00:00 2001 From: Jarkko Hietaniemi Date: Mon, 6 May 2002 12:12:59 +0000 Subject: Ultimate discouragement for the old tools, from Andreas. p4raw-id: //depot/perl@16428 --- Porting/p4d2p | 84 ----------------------------------------------------------- 1 file changed, 84 deletions(-) delete mode 100755 Porting/p4d2p (limited to 'Porting/p4d2p') diff --git a/Porting/p4d2p b/Porting/p4d2p deleted file mode 100755 index f645ef807e..0000000000 --- a/Porting/p4d2p +++ /dev/null @@ -1,84 +0,0 @@ -#!/l/local/bin/perl -wspi.bak - -# -# reads a perforce style diff on stdin and outputs appropriate headers -# so the diff can be applied with the patch program -# -# Gurusamy Sarathy -# - -BEGIN { - $0 =~ s|.*/||; - if ($h or $help) { - print STDERR < change-123.patch - -USAGE - exit(0); - } - unless (@ARGV) { @ARGV = '-'; undef $^I; } - use vars qw($thisfile $time $file $fnum $v $h $help); - $thisfile = ""; - $time = localtime(time); -} - -my ($cur, $match); -$cur = m<^==== //depot/(.+?)\#\d+.* ====$> ... m<^(\@\@.+\@\@|\*+)$>; - -$match = $1; - -if ($ARGV ne $thisfile) { - warn "processing patchfile [$ARGV]\n" unless $ARGV eq '-'; - $thisfile = $ARGV; -} - -# while we are within range -if ($cur) { - # set the file name after first line - if ($cur == 1) { - $file = $match; - $fnum++; - } - # emit the diff header when we hit last line - elsif ($cur =~ /E0$/) { - my $f = $file; - - # special hack for perl so we can always use "patch -p1" - $f =~ s<^.*?(perl.*?/)><$1>; - - # unified diff - if ($match =~ /^\@/) { - warn "emitting udiff header\n" if $v; - $_ = "Index: $f\n--- $f.~1~\t$time\n+++ $f\t$time\n$_"; - } - # context diff - elsif ($match =~ /^\*/) { - warn "emitting cdiff header\n" if $v; - $_ = "Index: $f\n*** $f.~1~\t$time\n--- $f\t$time\n$_"; - } - } - # see if we hit another patch (i.e. previous patch was empty) - elsif (m<^==== //depot/(.+?)\#\d+.* ====$>) { - $file = $match = $1; - } - # suppress all other lines in the header - else { - $_ = ""; - } - warn "file [$file] line [$cur] file# [$fnum]\n" if $v; -} - -$_ .= "End of Patch.\n" if eof; -- cgit v1.2.1