aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJorge Manuel B. S. Vicetto (jmbsvicetto) <jmbsvicetto@gentoo.org>2016-06-19 12:13:03 +0000
committerJorge Manuel B. S. Vicetto (jmbsvicetto) <jmbsvicetto@gentoo.org>2016-06-19 12:13:03 +0000
commitd485ef42ae4a6374e6215a3fa3e70d2ad06a4085 (patch)
treefe70a4111696c8f95c517b29115e2ca48e189a17 /listify
parentAllow running votify outside of /etc/elections and the repository dir. (diff)
downloadelections-d485ef42ae4a6374e6215a3fa3e70d2ad06a4085.tar.gz
elections-d485ef42ae4a6374e6215a3fa3e70d2ad06a4085.tar.bz2
elections-d485ef42ae4a6374e6215a3fa3e70d2ad06a4085.zip
Allow running listify and statify outside of /etc/elections and the repository dir.
Signed-off-by: Jorge Manuel B. S. Vicetto (jmbsvicetto) <jmbsvicetto@gentoo.org>
Diffstat (limited to 'listify')
-rwxr-xr-xlistify7
1 files changed, 5 insertions, 2 deletions
diff --git a/listify b/listify
index c8c24eb..7ca2bc3 100755
--- a/listify
+++ b/listify
@@ -8,11 +8,14 @@
#
BEGIN {
+ my $dirname;
if(-f '/etc/elections/Votify.pm') {
- push @INC, '/etc/elections';
+ $dirname = '/etc/elections';
} else {
- push @INC, '.' if -f 'Votify.pm';
+ use File::Basename;
+ $dirname = dirname(__FILE__);
}
+ push @INC, $dirname;
}
use POSIX;