From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (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 lists.proxmox.com (Postfix) with ESMTPS id 83E62954A4 for ; Mon, 26 Feb 2024 15:10:30 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 66FBE103D7 for ; Mon, 26 Feb 2024 15:10:30 +0100 (CET) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (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 firstgate.proxmox.com (Proxmox) with ESMTPS for ; Mon, 26 Feb 2024 15:10:26 +0100 (CET) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 8A163472B2 for ; Mon, 26 Feb 2024 15:10:26 +0100 (CET) From: Thomas Lamprecht To: pve-devel@lists.proxmox.com Date: Mon, 26 Feb 2024 15:10:20 +0100 Message-Id: <20240226141020.296052-2-t.lamprecht@proxmox.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240226141020.296052-1-t.lamprecht@proxmox.com> References: <20240226141020.296052-1-t.lamprecht@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL -0.056 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record T_SCC_BODY_TEXT_LINE -0.01 - Subject: [pve-devel] applied: [PATCH 2/2] run command: use explicit return undef in closures on call sites X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Feb 2024 14:10:30 -0000 To avoid a misinterpretation of the auto-return value: > In the absence of an explicit return, a subroutine, eval, or do FILE > automatically returns the value of the last expression evaluated. -- https://perldoc.perl.org/functions/return Signed-off-by: Thomas Lamprecht --- Proxmox/Install.pm | 5 +++++ Proxmox/Install/RunEnv.pm | 1 + 2 files changed, 6 insertions(+) diff --git a/Proxmox/Install.pm b/Proxmox/Install.pm index a0e1f5d..67093a1 100644 --- a/Proxmox/Install.pm +++ b/Proxmox/Install.pm @@ -121,6 +121,7 @@ sub create_filesystem { } elsif ($line =~ m/Writing superblocks and filesystem.*done/) { update_progress(1, $rs, $re); } + return; }); } @@ -358,6 +359,7 @@ sub get_pv_list_from_vgname { } else { $res->{$vg_uuid}->{pvs} .= ", $pv"; } + return; }; run_command("pvs --noheadings -o pv_name,vg_uuid -S vg_name='$vgname'", $parser, undef, 1); @@ -903,6 +905,7 @@ sub extract_data { my $frac = $per > 100 ? 1 : $per/100; update_progress($frac, $maxper, 0.5); } + return; }); syscmd("mount -n -t tmpfs tmpfs $targetdir/tmp") == 0 || die "unable to mount tmpfs on $targetdir/tmp\n"; @@ -1004,6 +1007,7 @@ sub extract_data { if ($line =~ m/^UUID=([A-Fa-f0-9\-]+)$/) { $fsuuid = $1; } + return; }); die "unable to detect FS UUID" if !defined($fsuuid); @@ -1114,6 +1118,7 @@ _EOD if ($line =~ m/Setting up\s+(\S+)/) { update_progress((++$count)/$pkg_count, 0.75, 0.95, "configuring $1"); } + return; }); unlink "$targetdir/etc/mailname"; diff --git a/Proxmox/Install/RunEnv.pm b/Proxmox/Install/RunEnv.pm index d7ccea6..25b6bb3 100644 --- a/Proxmox/Install/RunEnv.pm +++ b/Proxmox/Install/RunEnv.pm @@ -212,6 +212,7 @@ my sub detect_country_tracing_to : prototype($$) { log_info("DC FOUND: $country\n"); return CMD_FINISHED; } + return; } }, undef, undef, 1); -- 2.39.2