CSV has never worked, does not work, and will never work, pointless code is pointless. Removed. Did some misc. cleanup and don't import locale, we don't use it at all.

This commit is contained in:
Elijah Perrault committed 2011-03-30 22:10:52 -06:00
1 parent 051c189fe8
commit 3a8c2f31ba
1 file changed
+6 -23
+6 -23
View File
@@ -9,7 +9,6 @@ use strict;
use warnings; use warnings;
no feature qw(state); no feature qw(state);
use POSIX; use POSIX;
use locale;
use English qw(-no_match_vars); use English qw(-no_match_vars);
use Sys::Hostname; use Sys::Hostname;
use IO::Socket; use IO::Socket;
@@ -147,15 +146,11 @@ API::Std::event_add('on_sighup');
our ($DEBUG, $NUC); our ($DEBUG, $NUC);
my ($opt_help, $opt_version, $USECONFIG); my ($opt_help, $opt_version, $USECONFIG);
GetOptions( GetOptions(
'nuc' => \$NUC, 'nuc' => \$NUC,
'c=s' => \$USECONFIG, 'config|c=s' => \$USECONFIG,
'config=s' => \$USECONFIG, 'h|help' => \$opt_help,
'h' => \$opt_help, 'debug|d' => \$DEBUG,
'help' => \$opt_help, 'version|v' => \$opt_version,
'd' => \$DEBUG,
'debug' => \$DEBUG,
'v' => \$opt_version,
'version' => \$opt_version
); );
# If we were passed -h, print help. # If we were passed -h, print help.
@@ -306,18 +301,6 @@ given (lc((conf_get('database:format'))[0][0])) {
(conf_get('database:username'))[0][0], (conf_get('database:password'))[0][0]) or err(2, 'Failed to connect to database!', 1);; (conf_get('database:username'))[0][0], (conf_get('database:password'))[0][0]) or err(2, 'Failed to connect to database!', 1);;
} }
} }
# CSV no work. :(
#when ('csv') {
# # CSV.
# if ($ENFEAT !~ /csv/) { err(2, 'Auto not built with CSV support.', 1) }
# if (!conf_get('database:dir')) { err(2, 'Missing required configuration value database:dir. Aborting.', 1) }
#
# # Import DBD::CSV.
# require DBD::CSV;
#
# # Connect to database.
# $DB = DBI->connect("dbi:CSV:f_dir=$bin{etc}/".(conf_get('database:dir'))[0][0]) or err(2, 'Failed to connect to database!', 1);
#}
when ('pgsql') { when ('pgsql') {
# PostgreSQL. # PostgreSQL.
if ($ENFEAT !~ /pgsql/) { err(2, 'Auto not built with PostgreSQL support. Aborting.', 1) } if ($ENFEAT !~ /pgsql/) { err(2, 'Auto not built with PostgreSQL support. Aborting.', 1) }
@@ -568,7 +551,7 @@ sub socksnd {
my ($svr, $data) = @_; my ($svr, $data) = @_;
if (defined $SOCKET{$svr}) { if (defined $SOCKET{$svr}) {
syswrite $SOCKET{$svr}, $data."\r\n", POSIX::BUFSIZ, 0; syswrite $SOCKET{$svr}, "$data\r\n", POSIX::BUFSIZ, 0;
dbug "$svr << $data"; dbug "$svr << $data";
return 1; return 1;
} }