Changeset 22849

Show
Ignore:
Timestamp:
03.09.2010 17:56:17 (9 years ago)
Author:
ak19
Message:

Further changes to ticket 152 (movable collectdir. Both export.pl and exportcol.pl--for Export (to other formats) and Write To CD-Rom menu options, respectively--are now given a collectdir parameter so exporting can work for collections in non-standard collect directories.

Location:
main/trunk/greenstone2
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/bin/script/exportcol.pl

    r22360 r22849  
    5151    'deft' => "exported_collections", 
    5252    'reqd' => "no" }, 
     53      { 'name' => "collectdir", 
     54    'desc' => "{exportcol.collectdir}", 
     55    'type' => "string", 
     56    # parsearg left "" as default 
     57    #'deft' => &util::filename_cat ($ENV{'GSDLHOME'}, "collect"), 
     58    'deft' => "", 
     59    'reqd' => "no", 
     60    'hiddengli' => "yes" },  
    5361      { 'name' => "noinstall", 
    5462    'desc' => "{exportcol.noinstall}", 
     
    95103    my $xml = 0; 
    96104    my $gli = 0; 
     105    # the default/fallback for collect directory if none is provided 
     106    # (no -collectdir option given) is the standard Greenstone collect directory 
     107    my $collectdir = &util::filename_cat ($ENV{'GSDLHOME'}, "collect"); 
    97108 
    98109    my $hashParsingResult = {}; 
     
    129140    } 
    130141     
     142    # var collectdir (dir from where selected collections are exported to the CD)  
     143    # may have been set at this point if it was specified with -collectdir 
     144     
    131145    # can have more than one collection name,   
    132146    # if the first extra option is -h, then output the help 
     
    157171    my @valid_coll_list = (); 
    158172    foreach my $c (@coll_list) { 
    159     my $colldir = &util::filename_cat ($ENV{'GSDLHOME'}, "collect", $c); 
     173    my $colldir = &util::filename_cat ($collectdir, $c); 
    160174    if (! -d $colldir) { 
    161175        &gsprintf($out, "{exportcol.coll_not_found}\n", $c, $colldir); 
     
    202216    } 
    203217     
    204     my $collectdir = &util::filename_cat ($gsdldir, "collect"); 
    205     &util::mk_all_dir ($collectdir); 
     218    my $newcollectdir = &util::filename_cat ($gsdldir, "collect"); 
     219    &util::mk_all_dir ($newcollectdir); 
    206220    my $etcdir = &util::filename_cat ($gsdldir, "etc"); 
    207221    &util::mk_all_dir ($etcdir); 
     
    304318    foreach my $c (@valid_coll_list) { 
    305319    #old directories 
    306     my $colldir = &util::filename_cat ($ENV{'GSDLHOME'}, "collect", $c); 
     320    my $colldir = &util::filename_cat ($collectdir, $c); 
    307321    my $colindexdir = &util::filename_cat ($colldir, "index"); 
    308322    my $coletcdir = &util::filename_cat ($colldir, "etc"); 
     
    314328    my $colflashdir = &util::filename_cat ($colldir, "flash"); 
    315329 
    316     # new coll directory 
     330    # new collection directory 
    317331    # $c might be in a group, for now, copy to the top level. 
    318332    my $new_c = $c; 
    319333    $new_c =~ s/^.*[\/\\]//; # remove any folder info 
    320     my $newcoldir = &util::filename_cat ($collectdir, $new_c); 
     334    my $newcoldir = &util::filename_cat ($newcollectdir, $new_c); 
    321335 
    322336    &util::mk_all_dir ($newcoldir); 
  • main/trunk/greenstone2/perllib/strings.properties

    r22804 r22849  
    210210exportcol.cddir:The name of the directory that the CD contents are exported to. 
    211211exportcol.cdname:The name of the CD-ROM -- this is what will appear in the start menu once the CD-ROM is installed. 
     212exportcol.collectdir:The path of the "collect" directory. 
    212213exportcol.desc:PERL script used to export one or more collections to a Windows CD-ROM.  
    213214exportcol.noinstall:Create a CD-ROM where the library runs directly off the CD-ROM and nothing is installed on the host computer.