diff options
author | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2009-01-06 09:49:02 +0100 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2009-01-06 11:43:25 +0100 |
commit | 291c4ed918b57e9c4b05608a09c1279556b5b6ec (patch) | |
tree | 5d565c4e84d9b4ec9678c3f0776263f1084a1491 /Porting/p4d2p | |
parent | a44f43ac9f3e64cf7616266decab7e6aa6a22a56 (diff) | |
download | perl-291c4ed918b57e9c4b05608a09c1279556b5b6ec.tar.gz |
Remove a couple of p4-specific utilities
Diffstat (limited to 'Porting/p4d2p')
-rwxr-xr-x | Porting/p4d2p | 84 |
1 files changed, 0 insertions, 84 deletions
diff --git a/Porting/p4d2p b/Porting/p4d2p deleted file mode 100755 index 8003bf71a5..0000000000 --- a/Porting/p4d2p +++ /dev/null @@ -1,84 +0,0 @@ -#!/usr/bin/perl -wspi~ - -# -# reads a perforce style diff on stdin and outputs appropriate headers -# so the diff can be applied with the patch program -# -# Gurusamy Sarathy <gsar@activestate.com> -# - -BEGIN { - $0 =~ s|.*/||; - if ($h or $help) { - print STDERR <<USAGE; -Usage: $0 [-v] [-h] files - - -h print this help - -v output progress messages - -Does inplace edit of diff files output by the perforce commands -"p4 describe", "p4 diff", and "p4 diff2". The result is suitable -for feeding to the "patch" program. - -If no files are specified, reads from stdin and writes to stdout. - -WARNING: It only handles context or unified diffs. - -Example: p4 describe -du 123 | $0 > 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+.* ====( \w+)?$> ... 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+.* ====( \w+)?$>) { - $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; |