2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2026-07-31 18:19:40 +00:00

fix(nodech): handle comma-delimited values in the ,= operator

nodech's ,= operator appended the whole right-hand side as one value, so
"nodech n1 groups,=a,b" added the literal "a,b" and its duplicate check only
compared against that combined string. Split the value on commas and add each
piece individually, skipping any already present.

Recovered from the unmerged lenovobuild branch (original 086b0c0d).

Co-authored-by: Jarrod Johnson <10814490+jjohnson42@users.noreply.github.com>
This commit is contained in:
Vinícius Ferrão
2026-07-22 19:20:49 -03:00
parent cf44f51463
commit 6e33661fc0
+8 -5
View File
@@ -1742,11 +1742,14 @@ sub nodech
if ($cent) { $curval = $cent->{$key}; }
}
if ($curval) {
my @vals = split(/,/, $curval);
unless (grep /^$val$/, @vals) {
unshift @vals, $val;
my $newval = join(',', @vals);
$uhsh{$key} = $newval;
foreach my $subval (split /,/, $val) {
my @vals = split(/,/, $curval);
unless (grep /^$subval$/, @vals) {
unshift @vals, $subval;
my $newval = join(',', @vals);
$uhsh{$key} = $newval;
$curval = $newval;
}
}
} else {
$uhsh{$key} = $val;