From: Frantisek Hrbata <fhrb...@redhat.com>

redhat: sort config options based on their name only

Bugzilla: INTERNAL
Upstream Status: RHEL-only
Tested: make dist-configs-prep LC_ALL=C vs make dist-configs-prep 
LC_ALL=en_US.UTF-8
    generate the same config file, sorted content is the same as prior
    this change

The content of generated config files is sorted in build_configs.sh.
This gives unpredictable output if different locale is set. Let's
sort it purely on the config option name with C locale. This keeps
related options together no matter if they are set or not. Note that
this still slightly changes the order compared to order before this
change.

This is updated version of !2011 which was reverted.

Signed-off-by: Frantisek Hrbata <fhrb...@redhat.com>

diff --git a/redhat/configs/build_configs.sh b/redhat/configs/build_configs.sh
index blahblah..blahblah 100755
--- a/redhat/configs/build_configs.sh
+++ b/redhat/configs/build_configs.sh
@@ -108,7 +108,11 @@ function merge_configs()
                echo "# $arch" > "$name";;
        esac
 
-       sort config-merging."$count" >> "$name"
+       # sort config based on the config option names only
+       cat config-merging."$count" |
+               sed 's/^\(CONFIG_[^=]\+\)=\(.*\)/@ \1 =\2/' |
+               LC_ALL=C sort -k2,2 -b |
+               sed 's/@ \(CONFIG_[^ ]\+\) =\(.*\)/\1=\2/' >> "$name"
        rm -f config-merged."$count" config-merging."$count"
        echo "Building $name complete"
 }

--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2019
_______________________________________________
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/kernel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue

Reply via email to