Changeset 23362 for main/trunk/greenstone2/perllib/doc.pm
- Timestamp:
- 2010-12-01T11:40:36+13:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/perllib/doc.pm
r23278 r23362 64 64 # the docsave processor now calls set_lastmodified 65 65 66 $self-> {'source_path'} = $source_filename;66 $self->set_source_path($source_filename); 67 67 68 68 if (defined $source_filename) { … … 76 76 return $self; 77 77 } 78 79 80 sub set_source_path 81 { 82 my $self = shift @_; 83 my ($source_filename) = @_; 84 85 if (defined $source_filename) { 86 # On Windows the source_filename can be in terse DOS format 87 # e.g. test~1.txt 88 89 $self->{'terse_source_path'} = $source_filename; 90 91 if (-e $source_filename) { 92 # See if we can do better for Windows with a filename 93 if ($ENV{'GSDLOS'} =~ /^windows$/i) { 94 require Win32; 95 $self->{'source_path'} = Win32::GetLongPathName($source_filename); 96 } 97 else { 98 # For Unix-based systems, there is no difference between the two 99 $self->{'source_path'} = $source_filename; 100 } 101 } 102 else { 103 print STDERR "Warning: In doc::set_source_path(), file\n"; 104 print STDERR " $source_filename\n"; 105 print STDERR " does not exist\n"; 106 107 # (default) Set it to whatever we were given 108 $self->{'source_path'} = $source_filename; 109 } 110 } 111 else { 112 # Previous code for setting source_path allowed for 113 # it to be undefined, so continue this practice 114 $self->{'terse_source_path'} = undef; 115 $self->{'source_path'} = undef; 116 } 117 } 118 119 120 sub get_source_path 121 { 122 my $self = shift @_; 123 124 return $self->{'terse_source_path'}; 125 } 126 78 127 # set lastmodified for OAI purposes, added by GRB, moved by kjdon 79 128 sub set_lastmodified { 80 129 my $self = shift (@_); 81 130 82 my $source_path = $self->{' source_path'};131 my $source_path = $self->{'terse_source_path'}; 83 132 84 133 if (defined $source_path && (-e $source_path)) { … … 207 256 my $self = shift (@_); 208 257 209 return $self->{' source_path'};258 return $self->{'terse_source_path'}; 210 259 } 211 260
Note:
See TracChangeset
for help on using the changeset viewer.