bin:lng, and moved some stuff to the correct locations.

This commit is contained in:
Elijah Perrault committed 2011-03-11 21:32:24 -07:00
1 parent c1960f5837
commit 6033904d0d
1 file changed
+10 -6
+10 -6
View File
@@ -29,12 +29,15 @@ BEGIN {
if (!-e "$Bin/lib/Lib/Auto.pm") { if (!-e "$Bin/lib/Lib/Auto.pm") {
# Must be a system wide install. # Must be a system wide install.
$bin{lib} = "$Bin/../lib/autobot/3.0.0"; $bin{lib} = "$Bin/../lib/autobot/3.0.0";
$bin{bld} = "$bin{lib}/build";
$bin{lng} = "$bin{lib}/lang";
} }
else { else {
# Or not. # Or not.
$bin{lib} = "$Bin/../lib"; $bin{lib} = "$Bin/../lib";
$bin{bld} = "$Bin/../build";
$bin{lng} = "$Bin/../lang";
} }
$bin{bld} = "$bin{lib}/build";
} }
else { else {
# Must be a standard install. # Must be a standard install.
@@ -42,6 +45,7 @@ BEGIN {
$bin{var} = "$Bin/../var"; $bin{var} = "$Bin/../var";
$bin{lib} = "$Bin/../lib"; $bin{lib} = "$Bin/../lib";
$bin{bld} = "$Bin/../build"; $bin{bld} = "$Bin/../build";
$bin{lng} = "$Bin/../lang";
} }
unshift @INC, $bin{lib}; unshift @INC, $bin{lib};
@@ -257,14 +261,14 @@ given (lc((conf_get('database:format'))[0][0])) {
# Import DBD::SQLite. # Import DBD::SQLite.
require DBD::SQLite; require DBD::SQLite;
if (!-e "$Bin/../etc/".(conf_get('database:filename'))[0][0]) { if (!-e "$bin{etc}/".(conf_get('database:filename'))[0][0]) {
# Create <database:filename> if it's missing. # Create <database:filename> if it's missing.
open my $dbfh, '>', "$Bin/../etc/".(conf_get('database:filename'))[0][0]; open my $dbfh, '>', "$bin{etc}/".(conf_get('database:filename'))[0][0];
close $dbfh; close $dbfh;
chmod 0755, "$Bin/../etc/".(conf_get('database:filename'))[0][0]; chmod 0755, "$bin{etc}/".(conf_get('database:filename'))[0][0];
} }
# Connect to database. # Connect to database.
$DB = DBI->connect("dbi:SQLite:dbname=$Bin/../etc/".(conf_get('database:filename'))[0][0]) or err(2, 'Failed to connect to database!', 1); $DB = DBI->connect("dbi:SQLite:dbname=$bin{etc}/".(conf_get('database:filename'))[0][0]) or err(2, 'Failed to connect to database!', 1);
} }
when ('mysql') { when ('mysql') {
# MySQL. # MySQL.
@@ -298,7 +302,7 @@ given (lc((conf_get('database:format'))[0][0])) {
# require DBD::CSV; # require DBD::CSV;
# #
# # Connect to database. # # 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); # $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.