Changeset 2381
- Timestamp:
- 2001-05-08T10:28:03+12:00 (23 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/bin/script/build
r2359 r2381 308 308 } 309 309 &gsdl_import(); 310 &gsdl_build(); 310 if (&has_content ($archivedir, "^archives.inf\$")) { 311 &gsdl_build(); 312 } else { 313 my $msg = "build: ERROR: The collection could not be built as no\n"; 314 $msg .= " valid data was imported. Are at least some of\n"; 315 $msg .= " the files you imported in a format that can be\n"; 316 $msg .= " processed by the specified Greenstone plugins?\n"; 317 print $out $msg; 318 &log_event ($msg); 319 &final_out (6) if $use_out; 320 die "\n"; 321 } 311 322 } else { 312 323 # no import or archives 313 my $msg = "build: ERROR: The $collection collection has no import or archivesdata.\n";324 my $msg = "build: ERROR: The collection could not be built as it contains no data.\n"; 314 325 print $out $msg; 315 326 &log_event ($msg); … … 420 431 } 421 432 433 # return 1 if $dir directory contains any files or sub-directories (other 434 # than those specified in the $ignore regular expression) 422 435 sub has_content { 423 my ($dir ) = @_;436 my ($dir, $ignore) = @_; 424 437 425 438 if (!-d $dir) {return 0;} 426 439 427 440 opendir (DIR, $dir) || return 0; 428 441 my @files = readdir DIR; … … 431 444 foreach my $file (@files) { 432 445 if ($file !~ /^\.{1,2}$/) { 433 return 1 ;446 return 1 unless (defined $ignore && $file =~ /$ignore/); 434 447 } 435 448 }
Note:
See TracChangeset
for help on using the changeset viewer.