11 |
my $arg= shift @args; |
my $arg= shift @args; |
12 |
while ($arg) { |
while ($arg) { |
13 |
my $file= $arg; |
my $file= $arg; |
14 |
|
$filter{$file}= []; |
15 |
|
|
16 |
$arg= shift @args; |
$arg= shift @args; |
17 |
while ($arg and $arg=~ /\d+/) { |
while ($arg and $arg=~ /\d+/) { |
18 |
push @{$filter{$file}}, $arg; |
push @{$filter{$file}}, $arg; |
81 |
print $subPatch->{'header'}."\n"; |
print $subPatch->{'header'}."\n"; |
82 |
print $subPatch->{'takeOut'}."\n"; |
print $subPatch->{'takeOut'}."\n"; |
83 |
print $subPatch->{'putIn'}."\n"; |
print $subPatch->{'putIn'}."\n"; |
84 |
|
if (scalar @chunks==0) { |
85 |
|
# if no chunk specified, print all chunks |
86 |
|
@chunks= (1..scalar @{$subPatch->{'chunks'}}); |
87 |
|
} |
88 |
foreach my $chunk (@chunks) { |
foreach my $chunk (@chunks) { |
89 |
# shorthand for the chunk |
# shorthand for the chunk |
90 |
my $c= $subPatch->{'chunks'}[$chunk-1]; |
my $c= $subPatch->{'chunks'}[$chunk-1]; |
91 |
my $start= $c->{'data'}[0]+$accum; |
my $start= $c->{'data'}[0]+$accum; |
92 |
# fix for empty files |
# fix for empty files |
93 |
$start= 1 |
$start= 1 |
94 |
if $start==0; |
if ($start==0); |
95 |
print "@@ -".$c->{'data'}[0].",".$c->{'data'}[1]." +".$start.",".($c->{'data'}[1]+$c->{'data'}[2])." @@\n"; |
print "@@ -".$c->{'data'}[0].",".$c->{'data'}[1]." +".$start.",".($c->{'data'}[1]+$c->{'data'}[2])." @@\n"; |
96 |
foreach my $line (@{$c->{'lines'}}) { |
foreach my $line (@{$c->{'lines'}}) { |
97 |
print $line."\n"; |
print $line."\n"; |