From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id D14DD1382DE for ; Sun, 3 Jul 2016 11:04:46 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 1D4C5E0A86; Sun, 3 Jul 2016 11:04:46 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id B1DFCE0A86 for ; Sun, 3 Jul 2016 11:04:45 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id CDA3B340D96 for ; Sun, 3 Jul 2016 11:04:44 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 950FC13FF for ; Sun, 3 Jul 2016 11:04:41 +0000 (UTC) From: "Jorge Manuel B. S. Vicetto" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Jorge Manuel B. S. Vicetto" Message-ID: <1467543752.d95697a5993e3af4618556703c1f388f569f2c8f.jmbsvicetto@gentoo> Subject: [gentoo-commits] proj/elections:master commit in: / X-VCS-Repository: proj/elections X-VCS-Files: countify X-VCS-Directories: / X-VCS-Committer: jmbsvicetto X-VCS-Committer-Name: Jorge Manuel B. S. Vicetto X-VCS-Revision: d95697a5993e3af4618556703c1f388f569f2c8f X-VCS-Branch: master Date: Sun, 3 Jul 2016 11:04:41 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: a92eae29-3c42-47b8-9047-c745def178cb X-Archives-Hash: 628908d6667728d64da8ced50644d858 commit: d95697a5993e3af4618556703c1f388f569f2c8f Author: Jorge Manuel B. S. Vicetto (jmbsvicetto) gentoo org> AuthorDate: Sun Jul 3 11:02:32 2016 +0000 Commit: Jorge Manuel B. S. Vicetto gentoo 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) 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;