aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJorge Manuel B. S. Vicetto (jmbsvicetto) <jmbsvicetto@gentoo.org>2016-07-03 11:02:32 +0000
committerJorge Manuel B. S. Vicetto (jmbsvicetto) <jmbsvicetto@gentoo.org>2016-07-03 11:02:32 +0000
commitd95697a5993e3af4618556703c1f388f569f2c8f (patch)
tree50f86c52f8c12ff912c6e016f04974e995437420
parentFix Patrice nick with my apologies. (diff)
downloadelections-d95697a5993e3af4618556703c1f388f569f2c8f.tar.gz
elections-d95697a5993e3af4618556703c1f388f569f2c8f.tar.bz2
elections-d95697a5993e3af4618556703c1f388f569f2c8f.zip
Allow running countify outside of /etc/elections and the repository dir.
Signed-off-by: Jorge Manuel B. S. Vicetto (jmbsvicetto) <jmbsvicetto@gentoo.org>
-rwxr-xr-xcountify8
1 files changed, 5 insertions, 3 deletions
diff --git a/countify b/countify
index 1465da4..9f3e6f0 100755
--- a/countify
+++ b/countify
@@ -7,13 +7,15 @@
# countify: collect, tabulate and announce ballot results
#
-#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;