Changeset 17025 for gsdl/trunk/perllib
- Timestamp:
- 2008-08-27T20:32:27+12:00 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
gsdl/trunk/perllib/doc.pm
r16950 r17025 127 127 my ($type, $metadata) = @_; 128 128 129 if (defined $type && $type =~ /^(hash| incremental|dirname|assigned)$/) {129 if (defined $type && $type =~ /^(hash|hash_on_file|hash_on_ga_xml|incremental|dirname|assigned)$/) { 130 130 $self->{'OIDtype'} = $type; 131 131 } else { … … 286 286 if (!defined $OID) { 287 287 $OID = "NULL"; 288 if ($self->{'OIDtype'} eq "hash") {288 if ($self->{'OIDtype'} =~ /^hash/) { 289 289 $use_hash_oid = 1; 290 290 } elsif ($self->{'OIDtype'} eq "incremental") { … … 312 312 my $identifier = $self->get_metadata_element ($self->get_top_section(), $self->{'OIDmetadata'}); 313 313 if (defined $identifier && $identifier ne "") { 314 $OID = "D" .$identifier;314 $OID = $identifier; 315 315 $OID =~ s/\.//; #remove any periods 316 if ($OID =~ /^[\d]*$/) { 317 $OID = "D" . $OID; 318 print STDERR "OID only contains numbers, adding a D\n"; 319 } 320 316 321 } else { 317 322 # need a hash id … … 325 330 326 331 if ($use_hash_oid) { 327 328 # "hash" OID - feed file to hashfile.exe 329 #my $filename = $self->get_source_filename(); 330 # we want to use the converted file for hashing if available 331 # cos its quicker 332 my $filename = $self->get_filename_for_hashing(); 333 # -z: don't want to hash on the file if it is zero size 334 if (defined($filename) && -e $filename && !-z $filename) { 335 $OID = $self->_calc_OID ($filename); 336 } else { 337 $filename = &util::get_tmp_filename(); 332 my $hash_on_file = 1; 333 if ($self->{'OIDtype'} eq "hash_on_ga_xml") { 334 $hash_on_file = 0; 335 } 336 if ($hash_on_file) { 337 # "hash" OID - feed file to hashfile.exe 338 my $filename = $self->get_filename_for_hashing(); 339 # -z: don't want to hash on the file if it is zero size 340 if (defined($filename) && -e $filename && !-z $filename) { 341 $OID = $self->_calc_OID ($filename); 342 } else { 343 $hash_on_file = 0; 344 } 345 } 346 if (!$hash_on_file) { 347 my $filename = &util::get_tmp_filename(); 338 348 if (!open (OUTFILE, ">$filename")) { 339 349 print STDERR "doc::set_OID could not write to $filename\n";
Note:
See TracChangeset
for help on using the changeset viewer.