worker-utils: fix a perl experimental feature failure

In the cpumap_functions.sh, a one line perl script uses a perl
experimental feature which is added in perl 5.14 but removed
in perl 5.23 and later release, so fix to avoid using the
feature to fix failure with new perl releases.

Story: 2008204
Task: 40988

Change-Id: I90aa8bd3d7bd66d9d4d10c1987387dc6b32a2836
Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
This commit is contained in:
Jackie Huang 2020-09-27 09:50:56 +08:00
parent 8242257228
commit abbadaaff1
2 changed files with 39 additions and 1 deletions

@ -0,0 +1,35 @@
From e2dcf93685e6947540119fd5caff0e440857801c Mon Sep 17 00:00:00 2001
From: Jackie Huang <jackie.huang@windriver.com>
Date: Thu, 11 Jun 2020 22:41:00 +0800
Subject: [PATCH] cpumap_functions.sh: fix perl experimental feature issue
An experimental feature added in Perl 5.14 allowed each, keys, push,
pop, shift, splice, unshift, and values to be called with a scalar
argument. This experiment is considered unsuccessful, and has been
removed in 5.23 and later releases. So don't use this feature to
avoid failure:
localhost:~# platform_expanded_cpu_list
Experimental keys on scalar is now forbidden at -e line 13.
Upstream-Status: Submitted [https://review.opendev.org/759783]
Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
---
utilities/worker-utils/worker-utils/cpumap_functions.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/utilities/worker-utils/worker-utils/cpumap_functions.sh b/utilities/worker-utils/worker-utils/cpumap_functions.sh
index ab961f4..ecbbb05 100644
--- a/utilities/worker-utils/worker-utils/cpumap_functions.sh
+++ b/utilities/worker-utils/worker-utils/cpumap_functions.sh
@@ -389,7 +389,7 @@ function topology_to_cpulist {
}
}
END {
- @cores = sort { $a <=> $b } keys $T{$socket};
+ @cores = sort { $a <=> $b } keys %{ $T{$socket} };
@sel_cores = splice @cores, $core_start, $num_cores;
@lcpus = ();
for $C (@sel_cores) {
--
2.7.4

@ -7,7 +7,10 @@ SUBPATH0 = "utilities/worker-utils/worker-utils"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57"
SRC_URI += "file://0001-worker-utils-account-for-distro-PATH-differeces.patch;striplevel=4"
SRC_URI += " \
file://0001-worker-utils-account-for-distro-PATH-differeces.patch;striplevel=4 \
file://0001-cpumap_functions.sh-fix-perl-experimental-feature-is.patch;striplevel=4 \
"
RDEPENDS_${PN}_append = " perl systemd python bash"
DEPENDS += " python"