45 |
|
for(my $i=0; $i<=$#{$self->{includesdesc}}; $i++ ) { |
46 |
|
$inc=$self->{includesdesc}[$i]; |
47 |
|
$startline=$inc->startline(); |
48 |
< |
last if ( $line < $startline ); |
49 |
< |
if ( $line > ($inc->lines()+$startline) ) { |
50 |
< |
$line=$line-$inc->lines()+1+($inc->endline()-$startline); |
48 |
> |
last if ( $line <= $startline ); |
49 |
> |
if ( $line >= ($inc->lines()+$startline+2) ) { |
50 |
> |
# take out the 2 carriage returns added |
51 |
> |
$line=$line-($inc->lines()+$startline-$inc->endline())-2; |
52 |
|
# n lines in original map to m lines in expanded |
53 |
|
} |
54 |
|
else { # must be in the include file |
55 |
< |
($line, $fileob)=$self->{includes}[$i]-> |
56 |
< |
line($line-$startline+1); |
55 |
> |
($line, $fileob)=$self->{includes}[$i]->realline($line-$startline); |
56 |
> |
last; |
57 |
|
} |
58 |
|
} |
59 |
|
|
70 |
|
my $self=shift; |
71 |
|
|
72 |
|
if ( @_ ) { |
73 |
< |
my $url=shift; |
74 |
< |
($self->{url}, $file)=$self->{urlhandler}->get($url); |
75 |
< |
} |
76 |
< |
else { |
77 |
< |
$self->{url}; |
78 |
< |
} |
73 |
> |
my $url=shift; |
74 |
> |
($self->{url}, $file)=$self->{urlhandler}->get($url); |
75 |
> |
} |
76 |
> |
else { |
77 |
> |
$self->{url}; |
78 |
> |
} |
79 |
|
} |
80 |
|
|
81 |
|
sub ProcessedFile { |
90 |
|
return $file; |
91 |
|
} |
92 |
|
|
93 |
+ |
sub ProcessFile { |
94 |
+ |
my $self=shift; |
95 |
+ |
return $self->file(); |
96 |
+ |
} |
97 |
|
|
98 |
|
sub update { |
99 |
|
my $self=shift; |
125 |
|
} |
126 |
|
|
127 |
|
if ( $rv != 0 ) { |
128 |
< |
print " Need to Update ".$self->url()."\n"; |
128 |
> |
$self->verbose(" Need to Update ".$self->url()); |
129 |
|
# ---- sort out the preprocessed file in the cache |
130 |
|
my $newfile=$self->config()->cache()-> |
131 |
|
filename($outfile); |
137 |
|
$self->config->store($self,$self->url()); |
138 |
|
} |
139 |
|
else { |
140 |
< |
print "No Need to Update ".$self->url()."\n"; |
140 |
> |
$self->verbose("No Need to Update ".$self->url()); |
141 |
|
} |
142 |
|
return $rv; |
143 |
|
} |
162 |
|
$self->parse("include", $self->{fileout}, "include_starttag"); |
163 |
|
|
164 |
|
$self->{fileout}->close(); |
165 |
+ |
$self->verbose("$fileout Created"); |
166 |
|
} |
167 |
|
|
168 |
|
sub store { |