source: gsdl/trunk/bin/script/full-import.pl@ 19410

Last change on this file since 19410 was 19410, checked in by ak19, 15 years ago

Further modifications to launching perl on windows in the new incremental and full building scripts: Removed the check inside the BEGIN statement that insisted on PERLPATH being defined. Now the code uses PERLPATH for launching Perl on Windows if this is defined, otherwise it refers to just perl (assuming it is on the PATH already).

  • Property svn:executable set to *
File size: 1.8 KB
Line 
1#!/usr/bin/perl -w
2
3###########################################################################
4#
5# full-import.pl -- runs import.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 import (or re-import) a collection from scratch
30# Runs: import.pl -removeold ...
31
32
33BEGIN {
34 die "GSDLOS not set\n" unless defined $ENV{'GSDLOS'};
35}
36
37use strict;
38
39my $quoted_argv = join(" ", map { "\"$_\"" } @ARGV);
40
41my $import_cmd = "import.pl -removeold $quoted_argv";
42if($ENV{'GSDLOS'} =~ m/windows/) {
43 if($ENV{'PERLPATH'}) {
44 $import_cmd = "$ENV{'PERLPATH'}\\Perl.exe -S $import_cmd";
45 } else {
46 $import_cmd = "perl -S $import_cmd";
47 }
48}
49
50my $import_status = system($import_cmd)/256;
51
52if ($import_status != 0) {
53 print STDERR "Error: Failed to run: $import_cmd\n";
54 print STDERR " $!\n" if ($! ne "");
55 exit(-1);
56}
57
Note: See TracBrowser for help on using the repository browser.