source: main/trunk/greenstone2/bin/script/removedocument.pl@ 21642

Last change on this file since 21642 was 21642, checked in by mdewsnip, 14 years ago

Changed IncrementalBuildUtils::deleteDocument() to take the infodbtype type as a parameter, instead of assuming GDBM. Part of making the code less GDBM-specific.

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 944 bytes
Line 
1#!/usr/bin/perl -w
2
3BEGIN {
4 die "GSDLHOME not set\n" unless defined $ENV{'GSDLHOME'};
5 die "GSDLOS not set\n" unless defined $ENV{'GSDLOS'};
6 unshift (@INC, "$ENV{'GSDLHOME'}/bin/script");
7 unshift (@INC, "$ENV{'GSDLHOME'}/perllib");
8 unshift (@INC, "$ENV{'GSDLHOME'}/perllib/cpan");
9 unshift (@INC, "$ENV{'GSDLHOME'}/collect/lld/perllib");
10}
11
12use util;
13
14use IncrementalBuildUtils; # Include John's incremental building API
15
16# Ensure the collection specific binaries are on the search path
17my $path_separator = ":";
18$ENV{'PATH'} = &util::filename_cat($ENV{'GSDLHOME'}, "bin", $ENV{'GSDLOS'}) .
19$path_separator . &util::filename_cat($ENV{'GSDLHOME'}, "bin", "script") .
20$path_separator . $ENV{'PATH'};
21
22if(!$ARGV[0] || !$ARGV[1]) {
23 print STDERR "Usage: removedocument <collection> <oid>\n";
24 exit;
25}
26
27my $collection = $ARGV[0];
28my $oid = $ARGV[1];
29
30&IncrementalBuildUtils::deleteDocument($collection, "gdbm", $oid);
31
32exit;
Note: See TracBrowser for help on using the repository browser.