Ignore:
Timestamp:
2001-03-08T15:45:10+13:00 (23 years ago)
Author:
sjboddie
Message:

tinkered with the export collection function a little so that it only
exports those parts of a collection that are required at display time

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/bin/script/exportcol.pl

    r2075 r2138  
    6262    $out = OUT;
    6363    $close_out = 1;
     64    }
     65
     66    # make sure the collection is built (or at least contains all the
     67    # directories we expect it to) - we expect that it should contain an
     68    # index and an etc directory and will also copy across an images
     69    # directory if it exists
     70    my $colindexdir = &util::filename_cat ($ENV{'GSDLHOME'}, "collect", $collection, "index");
     71    my $colimagesdir = &util::filename_cat ($ENV{'GSDLHOME'}, "collect", $collection, "images");
     72    my $coletcdir = &util::filename_cat ($ENV{'GSDLHOME'}, "collect", $collection, "etc");
     73    if ((!-d $colindexdir) || (!-d $coletcdir)) {
     74    print $out "exportcol.pl failed: One or more the the following necessary\n";
     75    print $out "directories does not exist\n\n";
     76    print $out "  $colindexdir\n";
     77    print $out "  $coletcdir\n";
    6478    }
    6579
     
    143157
    144158    # copy the collection itself
    145     &util::cp_r (&util::filename_cat($ENV{'GSDLHOME'}, "collect", $collection), $collectdir);
     159    my $thiscoldir = &util::filename_cat ($collectdir, $collection);
     160    &util::mk_all_dir ($thiscoldir);
     161    &util::cp_r ($colindexdir, $thiscoldir);
     162    &util::cp_r ($coletcdir, $thiscoldir);
     163    &util::cp_r ($colimagesdir, $thiscoldir) if (-e $colimagesdir);
    146164
    147165    print $out "exportcol.pl succeeded: The exported collection is in $topdir\n";
Note: See TracChangeset for help on using the changeset viewer.