Gentoo Archives: gentoo-commits

From: "Jorge Manuel B. S. Vicetto" <jmbsvicetto@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/elections:master commit in: /
Date: Sun, 03 Jul 2016 11:04:46
Message-Id: 1467543752.d95697a5993e3af4618556703c1f388f569f2c8f.jmbsvicetto@gentoo
1 commit: d95697a5993e3af4618556703c1f388f569f2c8f
2 Author: Jorge Manuel B. S. Vicetto (jmbsvicetto) <jmbsvicetto <AT> gentoo <DOT> org>
3 AuthorDate: Sun Jul 3 11:02:32 2016 +0000
4 Commit: Jorge Manuel B. S. Vicetto <jmbsvicetto <AT> gentoo <DOT> org>
5 CommitDate: Sun Jul 3 11:02:32 2016 +0000
6 URL: https://gitweb.gentoo.org/proj/elections.git/commit/?id=d95697a5
7
8 Allow running countify outside of /etc/elections and the repository dir.
9
10 Signed-off-by: Jorge Manuel B. S. Vicetto (jmbsvicetto) <jmbsvicetto <AT> gentoo.org>
11
12 countify | 8 +++++---
13 1 file changed, 5 insertions(+), 3 deletions(-)
14
15 diff --git a/countify b/countify
16 index 1465da4..9f3e6f0 100755
17 --- a/countify
18 +++ b/countify
19 @@ -7,13 +7,15 @@
20 # countify: collect, tabulate and announce ballot results
21 #
22
23 -#BEGIN { push @INC, (getpwnam 'fox2mike')[7].'/elections' }
24 BEGIN {
25 + my $dirname;
26 if(-f '/etc/elections/Votify.pm') {
27 - push @INC, '/etc/elections';
28 + $dirname = '/etc/elections';
29 } else {
30 - push @INC, '.' if -f 'Votify.pm';
31 + use File::Basename;
32 + $dirname = dirname(__FILE__);
33 }
34 + push @INC, $dirname;
35 }
36
37 use POSIX;