stx-utilities: fix a perl experimental feature failure
[pti/rtp.git] / meta-stx / recipes-core / stx-utilities / files / 0001-cpumap_functions.sh-fix-perl-experimental-feature-is.patch
1 From e2dcf93685e6947540119fd5caff0e440857801c Mon Sep 17 00:00:00 2001
2 From: Jackie Huang <jackie.huang@windriver.com>
3 Date: Thu, 11 Jun 2020 22:41:00 +0800
4 Subject: [PATCH] cpumap_functions.sh: fix perl experimental feature issue
5
6 An experimental feature added in Perl 5.14 allowed each, keys, push,
7 pop, shift, splice, unshift, and values to be called with a scalar
8 argument. This experiment is considered unsuccessful, and has been
9 removed in 5.23 and later releases. So don't use this feature to
10 avoid failure:
11 localhost:~# platform_expanded_cpu_list
12 Experimental keys on scalar is now forbidden at -e line 13.
13
14 Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
15 ---
16  utilities/worker-utils/worker-utils/cpumap_functions.sh | 2 +-
17  1 file changed, 1 insertion(+), 1 deletion(-)
18
19 diff --git a/utilities/worker-utils/worker-utils/cpumap_functions.sh b/utilities/worker-utils/worker-utils/cpumap_functions.sh
20 index ab961f4..ecbbb05 100644
21 --- a/utilities/worker-utils/worker-utils/cpumap_functions.sh
22 +++ b/utilities/worker-utils/worker-utils/cpumap_functions.sh
23 @@ -389,7 +389,7 @@ function topology_to_cpulist {
24      }
25  }
26  END {
27 -    @cores = sort { $a <=> $b } keys $T{$socket};
28 +    @cores = sort { $a <=> $b } keys %{ $T{$socket} };
29      @sel_cores = splice @cores, $core_start, $num_cores;
30      @lcpus = ();
31      for $C (@sel_cores) {
32 -- 
33 2.7.4
34