diff options
author | Robin H. Johnson <robbat2@gentoo.org> | 2016-07-21 10:57:47 -0700 |
---|---|---|
committer | Robin H. Johnson <robbat2@gentoo.org> | 2016-07-21 10:57:47 -0700 |
commit | 672613c1a37c84d7af4dc0d56b2df3a138ca5813 (patch) | |
tree | 8c3c6407ab0e5c8db469644fb1bdfe67fe20409f | |
parent | Prepare the trustees-201606 election. (diff) | |
download | elections-672613c1a37c84d7af4dc0d56b2df3a138ca5813.tar.gz elections-672613c1a37c84d7af4dc0d56b2df3a138ca5813.tar.bz2 elections-672613c1a37c84d7af4dc0d56b2df3a138ca5813.zip |
Resolve symlinks to find the correct elections directory.
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
-rw-r--r-- | Votify.pm | 2 | ||||
-rwxr-xr-x | countify | 5 | ||||
-rwxr-xr-x | listify | 5 | ||||
-rwxr-xr-x | statify | 5 | ||||
-rwxr-xr-x | votify | 5 |
5 files changed, 13 insertions, 9 deletions
@@ -19,7 +19,7 @@ use strict; use warnings; our $datefmt = '%Y-%m-%d %H:%M:%S UTC'; -our ($basedir) = List::Util::first { -d $_ } ('/etc/elections', dirname(__FILE__)); +our ($basedir) = List::Util::first { -d $_ } ('/etc/elections', dirname(abs_path(__FILE__))); (our $zero = $0) =~ s,.*/,,; our $version = '1.6'; @@ -12,8 +12,9 @@ BEGIN { if(-f '/etc/elections/Votify.pm') { $dirname = '/etc/elections'; } else { - use File::Basename; - $dirname = dirname(__FILE__); + use Cwd qw(abs_path); + use File::Basename qw(dirname); + $dirname = dirname(abs_path(__FILE__)); } push @INC, $dirname; } @@ -12,8 +12,9 @@ BEGIN { if(-f '/etc/elections/Votify.pm') { $dirname = '/etc/elections'; } else { - use File::Basename; - $dirname = dirname(__FILE__); + use Cwd qw(abs_path); + use File::Basename qw(dirname); + $dirname = dirname(abs_path(__FILE__)); } push @INC, $dirname; } @@ -13,8 +13,9 @@ BEGIN { if(-f '/etc/elections/Votify.pm') { $dirname = '/etc/elections'; } else { - use File::Basename; - $dirname = dirname(__FILE__); + use Cwd qw(abs_path); + use File::Basename qw(dirname); + $dirname = dirname(abs_path(__FILE__)); } push @INC, $dirname; } @@ -12,8 +12,9 @@ BEGIN { if(-f '/etc/elections/Votify.pm') { $dirname = '/etc/elections'; } else { - use File::Basename; - $dirname = dirname(__FILE__); + use Cwd qw(abs_path); + use File::Basename qw(dirname); + $dirname = dirname(abs_path(__FILE__)); } push @INC, $dirname; } |