commit:     d95697a5993e3af4618556703c1f388f569f2c8f
Author:     Jorge Manuel B. S. Vicetto (jmbsvicetto) <jmbsvicetto <AT> gentoo 
<DOT> org>
AuthorDate: Sun Jul  3 11:02:32 2016 +0000
Commit:     Jorge Manuel B. S. Vicetto <jmbsvicetto <AT> gentoo <DOT> org>
CommitDate: Sun Jul  3 11:02:32 2016 +0000
URL:        https://gitweb.gentoo.org/proj/elections.git/commit/?id=d95697a5

Allow running countify outside of /etc/elections and the repository dir.

Signed-off-by: Jorge Manuel B. S. Vicetto (jmbsvicetto) <jmbsvicetto <AT> 
gentoo.org>

 countify | 8 +++++---
 1 file 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;

Reply via email to