From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id CDC221FF14F for ; Fri, 08 May 2026 20:46:40 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 4D3482150A; Fri, 8 May 2026 20:46:35 +0200 (CEST) From: Christoph Heiss To: pve-devel@lists.proxmox.com Subject: [PATCH installer 1/8] install: drop trivial fromjs() wrapper and use JSON::from_json() Date: Fri, 8 May 2026 20:44:04 +0200 Message-ID: <20260508184546.113293-2-c.heiss@proxmox.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260508184546.113293-1-c.heiss@proxmox.com> References: <20260508184546.113293-1-c.heiss@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1778265849123 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.076 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 Message-ID-Hash: DRJSM4KMYWXKSQRIF2B6I35LEK3EJI3Q X-Message-ID-Hash: DRJSM4KMYWXKSQRIF2B6I35LEK3EJI3Q X-MailFrom: c.heiss@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: .. in preparation for moving some subroutines. No functional changes. Signed-off-by: Christoph Heiss --- Proxmox/Install/RunEnv.pm | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/Proxmox/Install/RunEnv.pm b/Proxmox/Install/RunEnv.pm index a53fa8e..40041ad 100644 --- a/Proxmox/Install/RunEnv.pm +++ b/Proxmox/Install/RunEnv.pm @@ -14,10 +14,6 @@ use Proxmox::Sys::Net; use Proxmox::Install::ISOEnv; -my sub fromjs : prototype($) { - return from_json($_[0], { utf8 => 1 }); -} - my $_cached_arch = undef; sub query_arch : prototype() { @@ -106,7 +102,7 @@ my sub query_netdevs : prototype() { my $default; # FIXME: not the same as the battle proven way we used in the installer for years? - my $interfaces = fromjs(qx/ip --details --json address show/); + my $interfaces = from_json(qx/ip --details --json address show/, { utf8 => 1 }); my $pinned_counter = 0; for my $if (@$interfaces) { @@ -178,7 +174,7 @@ my sub query_routes : prototype() { my ($gateway4, $gateway6); log_info("query routes"); - my $route4 = fromjs(qx/ip -4 --json route show/); + my $route4 = from_json(qx/ip -4 --json route show/, { utf8 => 1 }); for my $route (@$route4) { if ($route->{dst} eq 'default') { $gateway4 = { @@ -189,7 +185,7 @@ my sub query_routes : prototype() { } } - my $route6 = fromjs(qx/ip -6 --json route show/); + my $route6 = from_json(qx/ip -6 --json route show/, { utf8 => 1 }); for my $route (@$route6) { if ($route->{dst} eq 'default') { $gateway6 = { @@ -310,7 +306,7 @@ sub query_installation_environment : prototype() { log_info("re-using cached runtime env from $run_env_file"); my $cached_env = eval { my $run_env_raw = Proxmox::Sys::File::file_read_all($run_env_file); - return fromjs($run_env_raw); # returns from eval + return from_json($run_env_raw, { utf8 => 1 }); # returns from eval }; log_error("failed to parse cached runtime env - $@") if $@; return $cached_env if defined($cached_env) && scalar keys $cached_env->%*; -- 2.53.0