Changeset 28001 for gs2-extensions/parallel-building/trunk/src
- Timestamp:
- 2013-08-08T12:46:06+12:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
gs2-extensions/parallel-building/trunk/src/perllib/parallelbuildinginexport.pm
r27995 r28001 30 30 package parallelbuildinginexport; 31 31 32 # Pragma 32 33 use strict; 34 no strict 'refs'; # allow filehandles to be variables and vice versa 35 no strict 'subs'; # allow barewords (eg STDERR) as function arguments 33 36 34 37 # MODULES … … 308 311 ## generate_statistics() ## 309 312 313 314 ## @function recordEarliestDatestamp() 315 # 316 # Check for existence of the file that's to contain earliestDateStamp in 317 # archivesdir Do nothing if the file already exists (file exists on incremental 318 # build). If the file doesn't exist, as happens on full build, create it and 319 # write out the current datestamp into it In buildcol, read the file's contents 320 # and set the earliestdateStamp in GS2's build.cfg / GS3's buildconfig.xml In 321 # doc.pm have set_oaiLastModified similar to set_lastmodified, and create the 322 # doc fields oailastmodified and oailastmodifieddate 323 # 324 sub recordEarliestDatestamp 325 { 326 my $self = shift(@_); 327 my ($infodbtype, $archivedir) = @_; 328 my $current_time_in_seconds = time; # in seconds 329 # We use the infodb to store this information if it supports it 330 if (defined(&dbutil::supportsDatestamp) && &dbutil::supportsDatestamp($infodbtype)) 331 { 332 my $datestamp_db = &dbutil::get_infodb_file_path($infodbtype, 'datestamp', $archivedir); 333 my $datestamp_db_fh = &dbutil::open_infodb_write_handle($infodbtype, $datestamp_db, 'append'); 334 &dbutil::write_infodb_rawentry($infodbtype, $datestamp_db_fh, 'earliest', $current_time_in_seconds); 335 &dbutil::close_infodb_write_handle($infodbtype, $datestamp_db_fh); 336 } 337 else 338 { 339 my $earliestDatestampFile = &FileUtils::filenameConcatenate($archivedir, "earliestDatestamp"); 340 if (!&FileUtils::fileExists($earliestDatestampFile) && &FileUtils::directoryExists($archivedir)) 341 { 342 my $datestamp_fh; 343 if(&FileUtils::openFileHandle($earliestDatestampFile, 'w', \$datestamp_fh)) 344 { 345 print $datestamp_fh $current_time_in_seconds; 346 &FileUtils::closeFileHandle($earliestDatestampFile, \$datestamp_fh); 347 } 348 else 349 { 350 &gsprintf(STDERR, "{import.cannot_write_earliestdatestamp}\n", $earliestDatestampFile); 351 } 352 } 353 } 354 } 355 ## recordEarliestDatestamp() ## 356 310 357 1;
Note:
See TracChangeset
for help on using the changeset viewer.