diff options
author | Jorge Manuel B. S. Vicetto (jmbsvicetto) <jmbsvicetto@gentoo.org> | 2016-07-03 11:02:32 +0000 |
---|---|---|
committer | Jorge Manuel B. S. Vicetto (jmbsvicetto) <jmbsvicetto@gentoo.org> | 2016-07-03 11:02:32 +0000 |
commit | d95697a5993e3af4618556703c1f388f569f2c8f (patch) | |
tree | 50f86c52f8c12ff912c6e016f04974e995437420 /countify | |
parent | Fix Patrice nick with my apologies. (diff) | |
download | elections-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>
Diffstat (limited to 'countify')
-rwxr-xr-x | countify | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -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; |