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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id B3C0E15ACFB for ; Wed, 19 Apr 2023 22:28:04 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id CC619E0805; Wed, 19 Apr 2023 22:28:03 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id A95BCE0805 for ; Wed, 19 Apr 2023 22:28:03 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 8B5E9341099 for ; Wed, 19 Apr 2023 22:28:02 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 7BC74141 for ; Wed, 19 Apr 2023 22:28:00 +0000 (UTC) From: "Robin H. Johnson" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Robin H. Johnson" Message-ID: <1681943270.ca7e83173e09bafdb5763df6fd50cec499b14a85.robbat2@gentoo> Subject: [gentoo-commits] proj/elections:master commit in: / X-VCS-Repository: proj/elections X-VCS-Files: Votify.pm X-VCS-Directories: / X-VCS-Committer: robbat2 X-VCS-Committer-Name: Robin H. Johnson X-VCS-Revision: ca7e83173e09bafdb5763df6fd50cec499b14a85 X-VCS-Branch: master Date: Wed, 19 Apr 2023 22:28:00 +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-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: e7441737-3917-466a-ba79-d5631a95823f X-Archives-Hash: 12927e73994d9d2289195f09792d8e32 commit: ca7e83173e09bafdb5763df6fd50cec499b14a85 Author: Robin H. Johnson gentoo org> AuthorDate: Wed Apr 19 22:27:50 2023 +0000 Commit: Robin H. Johnson gentoo org> CommitDate: Wed Apr 19 22:27:50 2023 +0000 URL: https://gitweb.gentoo.org/proj/elections.git/commit/?id=ca7e8317 Votify: handle empty control files, e.g. empty voters Signed-off-by: Robin H. Johnson gentoo.org> Votify.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Votify.pm b/Votify.pm index 6f73954..49f21da 100644 --- a/Votify.pm +++ b/Votify.pm @@ -132,8 +132,9 @@ sub get_single_election_hashref { #print STDERR "Scan $fn\n"; my @filenames = (sprintf("%s/%s", "$basedir/$election_name", $fn), sprintf("%s/%s-%s", "$basedir/$election_name", $fn, $election_name)); #print STDERR Dumper(@filenames); - my $filename = abs_path(List::Util::first { $_ && -r $_ && -s $_ && ! -d $_ } @filenames); - $election{"${fn}file"} = $filename; + my $filename = List::Util::first { $_ && -r $_ && -s $_ && ! -d $_ } @filenames; + my $absfilename = abs_path($filename) if $filename; + $election{"${fn}file"} = $absfilename if $absfilename; }; #print Dumper(%election); $election{starttime} = grabfile_int($election{'startfile'});