sub getFileIdx($);
sub getExt($);
sub getResult($);
-sub checkForHeader($);
+sub checkForHeader($$);
sub checkForPreamble($);
sub checkForLayoutStart($);
sub checkForInsetStart($);
sub checkForLatexCommand($);
-sub checkLyxLine($);
+sub checkLyxLine($$);
my @stack = (); # list of HASH-Arrays
my $rFont = {};
return($m->{"result"});
}
-sub checkForHeader($)
+sub checkForHeader($$)
{
- my ($l) = @_;
+ my ($l, $sourcedir) = @_;
if ($l =~ /^\\begin_header\s*$/) {
my %selem = ();
"filetype" => "replace_only",
"result" => ["\\origin $sysdir", "2"]);
push(@rElems, $origin);
+ my $originu = newMatch("search" => qr/^\\origin\s+unavailable/,
+ "filetype" => "replace_only",
+ "result" => ["\\origin $sourcedir"]);
+ push(@rElems, $originu);
setMatching(\@rElems);
return(1);
}
# separator: to be used while concatenating the filenames
# filetype: prefix_only,replace_only,copy_only,interpret
# same as before, but without 'prefix_for_list'
-sub checkLyxLine($)
+sub checkLyxLine($$)
{
- my ($l) = @_;
+ my ($l, $sourcedir) = @_;
- return({"found" => 0}) if (checkForHeader($l));
+ return({"found" => 0}) if (checkForHeader($l, $sourcedir));
return({"found" => 0}) if (checkForPreamble($l));
return({"found" => 0}) if (checkForEndBlock($l));
return({"found" => 0}) if (checkForLayoutStart($l));
$fi_line_no += 1;
$l =~ s/[\n\r]+$//;
#chomp($l);
- my $rStatus = checkLyxLine($l);
+ my $rStatus = checkLyxLine($l, $sourcedir);
if ($rStatus->{found}) {
my $rF = $rStatus->{result};
if ($rStatus->{"filetype"} eq "replace_only") {
}
}
}
- if ($foundrelative && $rStatus->{"filetype"} ne "prefix_for_list") {
+ if ($foundrelative && $rStatus->{"filetype"} !~ /^(prefix_for_list|prefix_only)$/) {
# The result can be relative too
# but, since prefix_for_list does no copy, we have to use absolute paths
# to address files inside the source dir