source: gsdl/trunk/bin/script/txtgz-to-gdbm.pl@ 19620

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

Missing execute permission on some perl scripts

  • Property svn:executable set to *
File size: 2.0 KB
Line 
1#!/usr/bin/perl -w
2
3###########################################################################
4#
5# txtgz-to-gdbm --
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) 1999 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 script invokes gzip to unzip the textual database. It is necessary,
30# since the C++ code that directly invokes it fails on Windows. The added
31# benefit of doing this via the perl script here is that if an external
32# webserver was used (such as Apache), it will probably still work.
33
34
35
36use strict;
37no strict 'refs'; # allow filehandles to be variables and vice versa
38no strict 'subs'; # allow barewords (eg STDERR) as function arguments
39
40my $txtgz_filename = $ARGV[0];
41my $gdbm_filename = $ARGV[1];
42
43
44if (scalar(@ARGV)!=2) {
45 my ($prog_name) = ($0 =~ m/^.*\/(.*?)$/);
46
47 print STDERR "Usage: $prog_name txtgz_filename gdbm_filename\n";
48 exit -1;
49}
50
51my $cmd = "gzip --decompress --to-stdout \"$txtgz_filename\" | txt2db \"$gdbm_filename\"";
52
53my $ret_status = system($cmd);
54
55#print STDERR "***## system error message $!\n";
56#print STDERR "***## ret status = $ret_status\n";
57
58#return $ret_status;
59
Note: See TracBrowser for help on using the repository browser.