Now installing lang/ properly, and config+language files are pulled from the current working directory.
This commit is contained in:
1 parent
6033904d0d
commit
580770c5b8
4 files changed
+9
-8
No files matched your search
@@ -24,8 +24,8 @@ BEGIN {
|
||||
$bin{cwd} = getcwd;
|
||||
if (!-e "$Bin/../build/syswide") {
|
||||
# Must be a custom PREFIX install.
|
||||
$bin{etc} = "$bin{cwd}/../etc";
|
||||
$bin{var} = "$bin{cwd}/../var";
|
||||
$bin{etc} = "$bin{cwd}/etc";
|
||||
$bin{var} = "$bin{cwd}/var";
|
||||
if (!-e "$Bin/lib/Lib/Auto.pm") {
|
||||
# Must be a system wide install.
|
||||
$bin{lib} = "$Bin/../lib/autobot/3.0.0";
|
||||
|
||||
@@ -200,6 +200,7 @@ if ($upref) {
|
||||
copy("$Bin/bin/genssl", "$PREFIX/bin/$bgenssl");
|
||||
chmod 0755, "$PREFIX/bin/auto", "$PREFIX/bin/$bgenssl", "$PREFIX/bin/$bbuildmod";
|
||||
rcopy("$Bin/lib/*", "$libdir/");
|
||||
rcopy("$Bin/lang/*", "$langdir/");
|
||||
copy("$Bin/etc/example.conf", "$distdir/");
|
||||
remove_tree("$libdir/File");
|
||||
}
|
||||
|
||||
@@ -13,17 +13,17 @@ sub new
|
||||
my $self = bless {}, $class;
|
||||
|
||||
# Check to see if the configuration file exists.
|
||||
if (!-e "$Auto::Bin/../etc/$file") {
|
||||
if (!-e "$Auto::bin{etc}/$file") {
|
||||
return 0;
|
||||
}
|
||||
|
||||
# Open, read and close the config.
|
||||
open(my $FCONF, q{<}, "$Auto::Bin/../etc/$file") or return 0;
|
||||
open(my $FCONF, q{<}, "$Auto::bin{etc}/$file") or return 0;
|
||||
my @cosfl = <$FCONF> or return 0;
|
||||
close $FCONF or return 0;
|
||||
|
||||
# Save it to self variable.
|
||||
$self->{'config'}->{'path'} = "$Auto::Bin/../etc/$file";
|
||||
$self->{'config'}->{'path'} = "$Auto::bin{etc}/$file";
|
||||
|
||||
return $self;
|
||||
}
|
||||
|
||||
+3
-3
@@ -13,15 +13,15 @@ sub parse
|
||||
my ($lang) = @_;
|
||||
|
||||
# Check that the language file exists.
|
||||
unless (-e "$Auto::Bin/../lang/$lang.alf") {
|
||||
if (!-e "$Auto::bin{lng}/$lang.alf") {
|
||||
# Otherwise, use English.
|
||||
dbug "Language '$lang' not found. Using English.";
|
||||
alog "Language '$lang' not found. Using English.";
|
||||
$lang = "en";
|
||||
$lang = 'en';
|
||||
}
|
||||
|
||||
# Open, read and close the file.
|
||||
open(my $FALF, q{<}, "$Auto::Bin/../lang/$lang.alf") or return 0;
|
||||
open(my $FALF, '<', "$Auto::bin{lng}/$lang.alf") or return 0;
|
||||
my @fbuf = <$FALF>;
|
||||
close $FALF;
|
||||
|
||||
|
||||
Reference in new issue
Block a user