scstadmin: Save multi-valued attributes sorted

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4927 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Bart Van Assche
2013-07-30 10:41:15 +00:00
parent 75f9be4b34
commit dfe644834c

View File

@@ -1281,12 +1281,14 @@ sub serializeKeyAttr {
&& defined($$attr_filter{$attribute})));
if (defined($$attributes{$attribute}->{'keys'})) {
foreach my $key (sort keys %{$$attributes{$attribute}->{'keys'}}) {
my @values;
foreach my $key (keys %{$$attributes{$attribute}->{'keys'}}) {
my $value =
$$attributes{$attribute}->{'keys'}->{$key}->{'value'};
if ($value ne '') {
$result .= "$prefix$attribute " . escapeMeta($value) . "\n";
}
push (@values, $value) if ($value ne '');
}
foreach my $value (sort @values) {
$result .= "$prefix$attribute " . escapeMeta($value) . "\n";
}
} elsif ($attribute eq 'enabled' || $attribute eq 'hw_target') {
my $value = $$attributes{$attribute}->{'value'};