Ignore:
Timestamp:
2007-12-19T15:03:24+13:00 (16 years ago)
Author:
dmn
Message:

davidbs changes to update for gs3 building

File:
1 edited

Legend:

Unmodified
Added
Removed
  • gsdl/trunk/bin/script/build

    r13067 r14925  
    9393
    9494my $cdir = $collectdir;
    95 $cdir = &util::filename_cat ($ENV{'GSDLHOME'}, "collect") unless $collectdir =~ /\w/;
     95if (defined $site)
     96{
     97    die "GSDL3HOME not set." unless $ENV{'GSDL3HOME'};
     98    $cdir = &util::filename_cat ($ENV{'GSDL3HOME'}, "sites", $site, "collect") unless $collectdir =~ /\w/;
     99}
     100else
     101{
     102    $cdir = &util::filename_cat ($ENV{'GSDLHOME'}, "collect") unless $collectdir =~ /\w/;
     103}
     104
    96105my $importdir = &util::filename_cat ($cdir, $collection, "import");
    97106my $archivedir = &util::filename_cat ($cdir, $collection, "archives");
     
    177186    print STDOUT "                           a -download option is supplied\n";
    178187    print STDOUT "   -collectdir directory   Collection directory (defaults to " .
    179     &util::filename_cat ($ENV{'GSDLHOME'}, "collect") . ")\n";
     188    &util::filename_cat($ENV{'GSDLHOME'}). "collect for Greenstone2;\n";
     189    print STDOUT"                            for Greenstone3 use -site option and then collectdir default will be\n";
     190    print STDOUT "                            set to the collect folder within that site.)\n";
     191    print STDOUT "   -site                   Specify the site within a Greenstone3 installation to use.\n";
    180192    print STDOUT "   -dontinstall            Only applicable if -collectdir is set to something\n";
    181193    print STDOUT "                           other than the default. -dontinstall will suppress\n";
     
    297309            my $download_cmd = "perl -S filecopy.pl";
    298310            $download_cmd .= " -collectdir \"$collectdir\"" if $collectdir =~ /\w/;
     311            $download_cmd .= " -site \"$site\"" if $site =~ /\w/;
    299312            $download_cmd .= " -out \"$outfile.download\"" if $use_out;
    300313            $download_cmd .= " \"" . $download_dir . "\" " . $collection;
    301             system ($download_cmd);
     314
     315            my $download_status = system ($download_cmd);
     316            if ($download_status > 0)
     317            {
     318            die "Failed to execute: $download_cmd\n";
     319            }
     320
     321
    302322            # if using output directory append the file download output to it
    303323            &append_file ($out, "$outfile.download");
     
    308328    }
    309329    }
     330
     331    `echo $importdir ; ls $importdir `;
    310332
    311333    if (-e &util::filename_cat ($archivedir, "archives.inf")) {
     
    355377
    356378    if ($collectdir ne "" && !$dontinstall) {
    357     my $install_collectdir = &util::filename_cat ($ENV{'GSDLHOME'}, "collect");
     379   
     380    my $install_collectdir;
     381    if (defined $ENV{'GSDL3HOME'})
     382    {
     383       
     384        if ((defined $site) && ($site ne ""))
     385        {
     386        $install_collectdir = &util::filename_cat ($ENV{'GSDL3HOME'}, "sites", $site, "collect");
     387        }
     388        else
     389        {
     390        my $msg = "build: ERROR: Need to specify the site within the Greenstone3 installation.";
     391        print $out $msg;
     392        &log_event ($msg);
     393        &final_out (6) if $use_out;
     394        die "\n";
     395        }
     396    }
     397    else
     398    {
     399        $install_collectdir = &util::filename_cat ($ENV{'GSDLHOME'}, "collect");
     400    }
     401
    358402    if (!&util::filenames_equal ($collectdir, $install_collectdir)) {
    359403       
     
    403447
    404448    $import_cmd .= " -manifest manifest.xml" if ($manifest);
     449    $import_cmd .= " -site \"$site\"" if $site =~ /\w/;
    405450    $import_cmd .= " -collectdir \"$collectdir\"" if $collectdir =~ /\w/;
    406451    $import_cmd .= " -statsfile \"$statsfile\"" if $statsfile =~ /\w/;
     
    447492
    448493    $build_cmd .= " -out \"$outfile.build\"" if $use_out;
     494    $build_cmd .= " -site \"$site\"" if $site =~ /\w/;
    449495    $build_cmd .= " -collectdir \"$collectdir\"" if $collectdir =~ /\w/;
    450496    $build_cmd .= " $maxdocs $collection";
     
    503549    }
    504550    }
     551
    505552    return 0;
    506553}
     
    605652             'download/.+', \@download,
    606653             'collectdir/.*/', \$collectdir,
     654             'site/.*/', \$site,
    607655             'dontinstall', \$dontinstall,
    608656             'save_archives', \$save_archives,
Note: See TracChangeset for help on using the changeset viewer.