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 |
> |
#+($inc->endline()-$startline); |
53 |
|
# n lines in original map to m lines in expanded |
54 |
+ |
print "Included file lines = ".$inc->lines()." +2 \n"; |
55 |
+ |
print "Start tag= $startline , endtag=".$inc->endline()."\n"; |
56 |
|
} |
57 |
|
else { # must be in the include file |
58 |
+ |
print "Passing $line-$startline \n"; |
59 |
|
($line, $fileob)=$self->{includes}[$i]-> |
60 |
< |
line($line-$startline+1); |
60 |
> |
realline($line-$startline); |
61 |
|
} |
62 |
|
} |
63 |
|
|
74 |
|
my $self=shift; |
75 |
|
|
76 |
|
if ( @_ ) { |
77 |
< |
my $url=shift; |
78 |
< |
($self->{url}, $file)=$self->{urlhandler}->get($url); |
79 |
< |
} |
80 |
< |
else { |
81 |
< |
$self->{url}; |
82 |
< |
} |
77 |
> |
my $url=shift; |
78 |
> |
($self->{url}, $file)=$self->{urlhandler}->get($url); |
79 |
> |
} |
80 |
> |
else { |
81 |
> |
$self->{url}; |
82 |
> |
} |
83 |
|
} |
84 |
|
|
85 |
|
sub ProcessedFile { |
94 |
|
return $file; |
95 |
|
} |
96 |
|
|
97 |
+ |
sub ProcessFile { |
98 |
+ |
my $self=shift; |
99 |
+ |
return $self->file(); |
100 |
+ |
} |
101 |
|
|
102 |
|
sub update { |
103 |
|
my $self=shift; |
129 |
|
} |
130 |
|
|
131 |
|
if ( $rv != 0 ) { |
132 |
< |
print " Need to Update ".$self->url()."\n"; |
132 |
> |
$self->verbose(" Need to Update ".$self->url()); |
133 |
|
# ---- sort out the preprocessed file in the cache |
134 |
|
my $newfile=$self->config()->cache()-> |
135 |
|
filename($outfile); |
141 |
|
$self->config->store($self,$self->url()); |
142 |
|
} |
143 |
|
else { |
144 |
< |
print "No Need to Update ".$self->url()."\n"; |
144 |
> |
$self->verbose("No Need to Update ".$self->url()); |
145 |
|
} |
146 |
|
return $rv; |
147 |
|
} |
166 |
|
$self->parse("include", $self->{fileout}, "include_starttag"); |
167 |
|
|
168 |
|
$self->{fileout}->close(); |
169 |
+ |
$self->verbose("$fileout Created"); |
170 |
|
} |
171 |
|
|
172 |
|
sub store { |