aboutsummaryrefslogtreecommitdiff
path: root/votify
diff options
context:
space:
mode:
authorJorge Manuel B. S. Vicetto (jmbsvicetto) <jmbsvicetto@gentoo.org>2016-06-19 12:05:35 +0000
committerJorge Manuel B. S. Vicetto (jmbsvicetto) <jmbsvicetto@gentoo.org>2016-06-19 12:05:35 +0000
commitfeb500c197990874101ae84aa51a6b718e96ae79 (patch)
tree53ee700c2fec3e779303d800b2410f128f8cf40c /votify
parentPrepare the council-201606 election. (diff)
downloadelections-feb500c197990874101ae84aa51a6b718e96ae79.tar.gz
elections-feb500c197990874101ae84aa51a6b718e96ae79.tar.bz2
elections-feb500c197990874101ae84aa51a6b718e96ae79.zip
Allow running votify outside of /etc/elections and the repository dir.
Signed-off-by: Jorge Manuel B. S. Vicetto (jmbsvicetto) <jmbsvicetto@gentoo.org>
Diffstat (limited to 'votify')
-rwxr-xr-xvotify8
1 files changed, 5 insertions, 3 deletions
diff --git a/votify b/votify
index e52881d..4fb688d 100755
--- a/votify
+++ b/votify
@@ -7,13 +7,15 @@
# votify: generate, verify and submit voting ballots for trustee elections
#
-#BEGIN { push @INC, (getpwnam 'fox2mike')[7].'/elections' }
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;