From 931d6b8e05b0f2683fe6eb1e4c5567cf6c26dc99 Mon Sep 17 00:00:00 2001 From: Jackie Huang Date: Thu, 11 Jun 2020 22:48:53 +0800 Subject: [PATCH] stx-utilities: fix a perl experimental feature failure 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 Change-Id: I618b255ecdc006d37bdefcf78860f0178cbfdeb6 --- ...tions.sh-fix-perl-experimental-feature-is.patch | 34 ++++++++++++++++++++++ .../stx-utilities/stx-utilities_git.bb | 1 + 2 files changed, 35 insertions(+) create mode 100644 meta-stx/recipes-core/stx-utilities/files/0001-cpumap_functions.sh-fix-perl-experimental-feature-is.patch 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 index 0000000..1eb66e5 --- /dev/null +++ b/meta-stx/recipes-core/stx-utilities/files/0001-cpumap_functions.sh-fix-perl-experimental-feature-is.patch @@ -0,0 +1,34 @@ +From e2dcf93685e6947540119fd5caff0e440857801c Mon Sep 17 00:00:00 2001 +From: Jackie Huang +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 +--- + 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 + diff --git a/meta-stx/recipes-core/stx-utilities/stx-utilities_git.bb b/meta-stx/recipes-core/stx-utilities/stx-utilities_git.bb index 50c3ed7..206fcd6 100644 --- a/meta-stx/recipes-core/stx-utilities/stx-utilities_git.bb +++ b/meta-stx/recipes-core/stx-utilities/stx-utilities_git.bb @@ -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 -- 2.16.6