Changeset 28236 for main/trunk/greenstone2
- Timestamp:
- 2013-09-06T18:29:14+12:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/perllib/util.pm
r28228 r28236 1297 1297 sub abspath_to_placeholders { 1298 1298 my $path = shift(@_); # path to convert from absolute to one with placeholders 1299 my $opt_long_or_short_winfilenames = shift(@_) || "short"; # whether we want to force use of long file names even on windows, default uses short 1299 1300 1300 1301 return $path unless is_abs_path_any_os($path); # path is relative 1302 1303 if ($opt_long_or_short_winfilenames eq "long") { 1304 $path = &util::upgrade_if_dos_filename($path); # will only do something on windows 1305 } 1301 1306 1302 1307 # now we know we're dealing with absolute paths and have to replace gs prefixes with placeholders … … 1311 1316 $path = &util::_abspath_to_placeholders($path, \@gs_paths, \%placeholder_map); 1312 1317 1313 if ($ENV{'GSDLOS'} =~ /^windows$/i ) {1318 if ($ENV{'GSDLOS'} =~ /^windows$/i && $opt_long_or_short_winfilenames eq "short") { 1314 1319 # for windows need to look for matches on short file names too 1315 1320 # matched paths are again to be replaced with the usual placeholders … … 1363 1368 sub placeholders_to_abspath { 1364 1369 my $path = shift(@_); # path that can contain placeholders to convert to resolved absolute path 1370 my $opt_long_or_short_winfilenames = shift(@_) || "short"; # whether we want to force use of long file names even on windows, default uses short 1365 1371 1366 1372 return $path if($path !~ m/@/); # path contains no placeholders … … 1372 1378 # can't use double-quotes around at-sign, else perl tries to evaluate it as referring to an array 1373 1379 my %placeholder_to_gspath_map; 1374 if ($ENV{'GSDLOS'} =~ /^windows$/i ) {1380 if ($ENV{'GSDLOS'} =~ /^windows$/i && $opt_long_or_short_winfilenames eq "short") { 1375 1381 # always replace placeholders with short file names of the absolute paths on windows? 1376 1382 %placeholder_to_gspath_map = ('@GSDLHOME@' => &util::downgrade_if_dos_filename($ENV{'GREENSTONEHOME'}),
Note:
See TracChangeset
for help on using the changeset viewer.