Have dump-finance-quote do a runtime check for F::Q to prevent RPM

dependencies.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@7985 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
David Hampton 2003-02-14 19:03:30 +00:00
parent b369620a0f
commit 1624687c56
2 changed files with 34 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2003-02-14 David Hampton <hampton@employees.org>
* src/quotes/dump-finance-quote: Do a runtime check for
Finance::Quote instead of including the perl 'use' declaration.
The latter causes RPM to add a dependancy on F::Q.
2003-02-13 Derek Atkins <derek@ihtfp.com>
* src/gnome-utils/dialog-options.c: guile-1.6 doesn't like

View File

@ -19,7 +19,31 @@
#
use strict;
use Finance::Quote;
sub check_modules {
my @modules = qw(Date::Manip Finance::Quote LWP);
my @missing;
foreach my $mod (@modules) {
if (eval "require $mod") {
$mod->import();
}
else {
push (@missing, $mod);
}
}
return unless @missing;
print STDERR "$0 cannot find all the Perl modules needed to run.\n";
print STDERR "You need to install the following Perl modules:\n";
foreach my $mod (@missing) {
print STDERR " ".$mod."\n";
}
print STDERR "Run 'update-finance-quote' as root to install them.\n";
exit 1;
}
sub report {
my($itemname, $qh) = @_;
@ -68,6 +92,9 @@ sub report {
print "\n";
}
# Check for and load non-standard modules
check_modules ();
my $q = Finance::Quote->new;
$q->timeout(60);