Changeset 7929


Ignore:
Timestamp:
2004-08-10T16:37:58+12:00 (20 years ago)
Author:
davidb
Message:

doc.pm modified so filename stored under gsdlsourcefilename is local
to collection.

Location:
trunk/gsdl/perllib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/perllib/doc.pm

    r7902 r7929  
    5656              'OIDtype'=>"hash"}, $class;
    5757
    58     $self->set_source_filename ($source_filename) if defined $source_filename;
     58    if (defined $source_filename) {
     59    my $collect_dir = $ENV{'GSDLCOLLECTDIR'};
     60
     61    if (defined $collect_dir) {
     62        my $dirsep = &util::get_dirsep();
     63        if ($collect_dir !~ m/$dirsep$/) {
     64        $collect_dir .= $dirsep;
     65        }
     66
     67        $collect_dir =~ s/\\/\\\\/g; # escape DOS style file separator
     68
     69        if ($source_filename =~ /^$collect_dir(.*)$/) {
     70        $source_filename = $1;
     71        }
     72    }
     73
     74    $self->set_source_filename ($source_filename);
     75    }
     76
    5977    $self->set_doc_type ($doc_type) if defined $doc_type;
    6078
  • trunk/gsdl/perllib/util.pm

    r7507 r7929  
    531531}
    532532
     533sub get_dirsep {
     534
     535    if ($ENV{'GSDLOS'} =~ /^windows$/i) {
     536    return "\\";
     537    } else {
     538    return "\/";
     539    }
     540}
     541
    533542sub get_os_dirsep {
    534543
Note: See TracChangeset for help on using the changeset viewer.