root/gsdl/trunk/bin/script/full-buildcol.pl @ 19409

Revision 19409, 2.0 KB (checked in by ak19, 11 years ago)

Getting the incremental build scripts to work on Windows (it already works on the Vista here, but only because .pl files were associated with Perl).

  • Property svn:executable set to *
Line 
1#!/usr/bin/perl -w
2
3###########################################################################
4#
5# full-buildcol.pl -- runs buildcol.pl with -removeold option on
6# A component of the Greenstone digital library software
7# from the New Zealand Digital Library Project at the
8# University of Waikato, New Zealand.
9#
10# Copyright (C) 2009 New Zealand Digital Library Project
11#
12# This program is free software; you can redistribute it and/or modify
13# it under the terms of the GNU General Public License as published by
14# the Free Software Foundation; either version 2 of the License, or
15# (at your option) any later version.
16#
17# This program is distributed in the hope that it will be useful,
18# but WITHOUT ANY WARRANTY; without even the implied warranty of
19# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20# GNU General Public License for more details.
21#
22# You should have received a copy of the GNU General Public License
23# along with this program; if not, write to the Free Software
24# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
25#
26###########################################################################
27
28
29# This program will "buildcol" (or re-"buildcol") a collection from scratch
30# Runs:        buildcol.pl -removeold ...
31
32BEGIN {
33    die "GSDLOS not set\n" unless defined $ENV{'GSDLOS'};
34    # for windows, need PERLPATH in order to launch Perl
35    if($ENV{'GSDLOS'} =~ m/windows/) {
36    die "PERLPATH, which is required for Windows, is not set.\n" unless defined $ENV{'PERLPATH'};
37    }
38}
39
40use strict;
41
42my $quoted_argv = join(" ", map { "\"$_\"" } @ARGV);
43
44
45my $buildcol_cmd = "buildcol.pl -removeold $quoted_argv";
46if($ENV{'GSDLOS'} =~ m/windows/) {
47    $buildcol_cmd = "$ENV{'PERLPATH'}\\Perl.exe -S $buildcol_cmd";
48    #$buildcol_cmd = "perl -S $buildcol_cmd";
49}
50
51my $buildcol_status = system($buildcol_cmd)/256;
52
53if ($buildcol_status != 0) {
54    print STDERR "Error: Failed to run: $buildcol_cmd\n";
55    print STDERR "       $!\n" if ($! ne "");
56    exit(-1);
57}
58
59
60
61
Note: See TracBrowser for help on using the browser.