stx-utilities: fix a perl experimental feature failure 12/4112/1
authorJackie Huang <jackie.huang@windriver.com>
Thu, 11 Jun 2020 14:48:53 +0000 (22:48 +0800)
committerJackie Huang <jackie.huang@windriver.com>
Tue, 16 Jun 2020 03:13:51 +0000 (11:13 +0800)
In the cpumap_functions.sh, a oneline 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.

Issue-ID: INF-162
Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
Change-Id: I618b255ecdc006d37bdefcf78860f0178cbfdeb6

meta-stx/recipes-core/stx-utilities/files/0001-cpumap_functions.sh-fix-perl-experimental-feature-is.patch [new file with mode: 0644]
meta-stx/recipes-core/stx-utilities/stx-utilities_git.bb

diff --git a/meta-stx/recipes-core/stx-utilities/files/0001-cpumap_functions.sh-fix-perl-experimental-feature-is.patch b/meta-stx/recipes-core/stx-utilities/files/0001-cpumap_functions.sh-fix-perl-experimental-feature-is.patch
new file mode 100644 (file)
index 0000000..1eb66e5
--- /dev/null
@@ -0,0 +1,34 @@
+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.
+
+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
+
index 50c3ed7..206fcd6 100644 (file)
@@ -52,6 +52,7 @@ LIC_FILES_CHKSUM = " \
 
 SRC_URI = " \
        git://opendev.org/starlingx/${SRCNAME}.git;protocol=${PROTOCOL};rev=${SRCREV};branch=${BRANCH} \
+       file://0001-cpumap_functions.sh-fix-perl-experimental-feature-is.patch \
        "
 
 inherit setuptools distutils python-dir systemd