diff options
author | cvs2git <cvs2git> | 2010-12-27 00:04:45 +0000 |
---|---|---|
committer | cvs2git <cvs2git> | 2010-12-27 00:04:45 +0000 |
commit | c82d349f864e6bd9f96fd1156903bc1f7193a203 (patch) | |
tree | e117a87533656110b6acd56fc0ca64289892a9f5 /bin/tax_rate_location.import | |
parent | 74e058c8a010ef6feb539248a550d0bb169c1e94 (diff) |
This commit was manufactured by cvs2svn to create tag 'TORRUS_1_0_9'.TORRUS_1_0_9
Diffstat (limited to 'bin/tax_rate_location.import')
-rwxr-xr-x | bin/tax_rate_location.import | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/bin/tax_rate_location.import b/bin/tax_rate_location.import deleted file mode 100755 index 439d27cc9..000000000 --- a/bin/tax_rate_location.import +++ /dev/null @@ -1,48 +0,0 @@ -#!/usr/bin/perl -Tw - -use strict; -use vars qw($opt_g $opt_f); -use vars qw($DEBUG); -use Getopt::Std; -use FS::UID qw(adminsuidsetup); -use FS::Conf; -use FS::tax_rate_location; - -getopts('f:g:'); - -my $user = shift or die &usage; -my $dbh = adminsuidsetup $user; - -my ($format) = $opt_f =~ /^([-\w]+)$/; - -my @list = ( - 'GEOCODE', $opt_g, \&FS::tax_rate_location::batch_import, -); - -my $oldAutoCommit = $FS::UID::AutoCommit; -local $FS::UID::AutoCommit = 0; - -my $error = ''; - -while(@list) { - my ($name, $file, $method) = splice(@list, 0, 3); - - my $fh; - - $file =~ /^([\s\d\w.]+)$/ or die "Illegal filename: $file\n"; - $file = $1; - - open $fh, '<', $file or die "can't open $name file: $!\n"; - $error ||= &{$method}( { filehandle => $fh, 'format' => $format, } ); - - die "error while processing $file: $error" if $error; - close $fh; -} - -if ($error) { - $dbh->rollback or die $dbh->errstr if $oldAutoCommit; -}else{ - $dbh->commit or die $dbh->errstr if $oldAutoCommit; -} - -sub usage { die "Usage:\ntax_rates_location.import -f FORMAT -g GEOCODEFILE user\n\n"; } |