UPSTREAM: Reapply "config: Don't directly modify FEATURES"

This reverts commit b150419d28bd7afb98404a829c639584d34efc03.

It turns out we need to keep the open coded version to avoid creating
a persistent setting.
See https://github.com/gentoo/portage/pull/1098#issuecomment-1761638611

This change just adds a sorted() so we get deterministic ordering.

Bug: https://bugs.gentoo.org/914441
Signed-off-by: Raul E Rangel <rrangel@chromium.org>
Closes: https://github.com/gentoo/portage/pull/1312
Signed-off-by: Zac Medico <zmedico@gentoo.org>
(cherry picked from commit 72f41d07b5396195a98691fafeb3e5b207a76564)

BUG=b:281732865
TEST=CQ

Change-Id: Ica2874c17711dbf3f9cc2380c58dd06acfe8c876
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/portage_tool/+/5485147
Auto-Submit: Raul Rangel <rrangel@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Raul Rangel <rrangel@chromium.org>
Tested-by: Raul Rangel <rrangel@chromium.org>
1 file changed