2
######################################################################
3
### gnc-fq-check - check for the presence of Finance::Quote
4
### From gnc-fq-helper.
5
### Copyright 2001 Rob Browning <rlb@cs.utexas.edu>
7
### This program is free software; you can redistribute it and/or
8
### modify it under the terms of the GNU General Public License as
9
### published by the Free Software Foundation; either version 2 of
10
### the License, or (at your option) any later version.
12
### This program is distributed in the hope that it will be useful,
13
### but WITHOUT ANY WARRANTY; without even the implied warranty of
14
### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
### GNU General Public License for more details.
17
### You should have received a copy of the GNU General Public License
18
### along with this program# if not, contact:
20
### Free Software Foundation Voice: +1-617-542-5942
21
### 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652
22
### Boston, MA 02110-1301, USA gnu@gnu.org
23
######################################################################
25
use lib '@-PERLINCL-@';
33
# Output (on standard output, one output form per input line):
35
# A list of quote sources supported by Finance::Quote, or the single
36
# term missing-lib if finance quote could not be executed.
44
my @modules = qw(Finance::Quote LWP HTML::Parser HTML::TableExtract Crypt::SSLeay Date::Manip);
47
foreach my $mod (@modules) {
48
if (eval "require $mod") {
52
push (@missing, $mod);
56
return unless @missing;
59
print STDERR "You need to install the following Perl modules:\n";
60
foreach my $mod (@missing) {
61
print STDERR " ".$mod."\n";
65
print STDERR "Use your system's package manager to install them,\n";
66
print STDERR "or run 'gnc-fq-update' as root.\n";
68
print "missing-lib\n";
73
#---------------------------------------------------------------------------
76
# Check for and load non-standard modules
79
# Create a stockquote object.
80
my $quoter = Finance::Quote->new();
81
my $prgnam = "gnc-fq-check";
84
my @sources = $quoter->sources();
85
foreach my $source (@sources) {
86
push(@qsources, "\"$source\"");
88
printf "(\"%s\" %s)\n", $Finance::Quote::VERSION, join(" ", qq/@qsources/);