Ignore:
Timestamp:
2013-11-12T19:10:18+13:00 (10 years ago)
Author:
ak19
Message:

Now gets open-office

File:
1 edited

Legend:

Unmodified
Added
Removed
  • other-projects/nightly-tasks/diffcol/trunk/task.pl

    r28606 r28615  
    487487}
    488488
     489sub getOpenOfficeExt
     490{   
     491    # current revision is 27763, but using "head" works
     492    my $OOEXT_TRAC_URL="http://trac.greenstone.org/export/head/gs2-extensions/open-office/trunk/open-office-java"; # both for .zip and .tar.gz extension
     493    #"http://trac.greenstone.org/export/".$ENV{'SVN_OPT_REV'}."/gs2-extensions/open-office/trunk/open-office-java";
     494
     495    # now get the OpenOffice extension for the AllDocTypes collection
     496    print STDERR "Getting open office ext from $OOEXT_TRAC_URL:\n";     
     497   
     498    chdir($greenstone_home);
     499    my $cmd = "";
     500    if ($isWin) {
     501        $cmd = "setup.bat && cd ext && wget $OOEXT_TRAC_URL.zip && unzip open-office-java.zip";
     502       
     503    } elsif ($isMac) { # need to use curl not wget
     504        $cmd = "cd ext && curl $OOEXT_TRAC_URL.tar.gz > open-office-java.tar.gz && tar -xzf open-office-java.tar.gz";
     505    }
     506    else { # linux
     507        $cmd = "bash -c \"export GSDLHOME=&& source setup.bash && cd ext && wget $OOEXT_TRAC_URL.tar.gz && tar -xzf open-office-java.tar.gz\"";
     508    }
     509    my $status = system $cmd;
     510    if($status != 0) {
     511        print STDERR "@@@ Failed to set up the Open Office Extension\n";
     512        exit -1; # or proceed to testing other tutorials?
     513    }
     514}
     515
    489516sub getIsisGdl {
    490517    my $gsfolder = shift(@_);
     
    514541    if($num_cols == 0) { # deal with all collections
    515542        push (@collections, "");
    516             # putting the empty string in the array so that the "all colleections" case
    517             # can be handled similarl to how the case of user-specified collections is handled
     543            # putting the empty string in the array so that the "all collections" case
     544            # can be handled similar to how the case of user-specified collections is handled
    518545       
    519546    } else { # deal with user specified set of collections
     
    527554    }
    528555
    529     &getIsisGdl("$greenstone_home");
     556    my $openofficeext = &filename_concat($greenstone_home, "ext", "open-office");
     557    if(!-d $openofficeext) {
     558        &getOpenOfficeExt();
     559    }
     560   
     561    #&getIsisGdl("$greenstone_home");
    530562
    531563    open (my $xml_fh, '>'.$xmlout) || die "Could not open xml file $xmlout for appending: $!\n";
Note: See TracChangeset for help on using the changeset viewer.