From bd3550840f53db02f8b1e2b29e5f9bdfba84b831 Mon Sep 17 00:00:00 2001 From: Admin Pupkin Date: Fri, 12 Jun 2026 18:00:43 +0300 Subject: [PATCH] kf6-kwindowsystem: C-7 migration patch (ecm_install_po_files_as_qm) + script exclude Second durable C-7 migration patch. Captures the inline sed chain in kf6-kwindowsystem's [build].script that comments out the `ecm_install_po_files_as_qm(poqm)` line in CMakeLists.txt. The patch is a 16-line single-file edit (CMakeLists.txt only) with no autogenerated noise. Script change: the diff command now also excludes `--exclude='.clang-format'` and `--exclude='.gitignore'`, which ECM (Extra CMake Modules) writes on every cmake configure step. Without these excludes, the patch would be ~120 lines of ECM autogenerated noise with the real Red Bear edit buried in the middle. This is a regression fix for kf6-kwindowsystem which had a clean real diff hidden under 95+ lines of clang-format config. Adds test_diff_excludes_ecm_generated_files (124 Python tests total, 17 in this file). All 7 test files pass. Migration status: 2/56 KF6 recipes migrated to external patches (kf6-karchive, kf6-kwindowsystem). The remaining 54 recipes will be migrated as their cook+diff completes; the migration script is now runnable end-to-end with no manual filtering required. --- .../01-initial-migration.patch | 23 +++++++++++++++++++ local/scripts/migrate-kf6-seds-to-patches.sh | 10 +++++++- local/scripts/tests/test_migrate_kf6_seds.py | 19 +++++++++++++++ 3 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 local/patches/kf6-kwindowsystem/01-initial-migration.patch diff --git a/local/patches/kf6-kwindowsystem/01-initial-migration.patch b/local/patches/kf6-kwindowsystem/01-initial-migration.patch new file mode 100644 index 0000000000..436fb791f1 --- /dev/null +++ b/local/patches/kf6-kwindowsystem/01-initial-migration.patch @@ -0,0 +1,23 @@ +# Initial migration of the inline sed -i chains in +# /home/kellito/Builds/RedBear-OS/local/recipes/kde/kf6-kwindowsystem/'s [build].script to a durable external +# patch. Captured by local/scripts/migrate-kf6-seds-to-patches.sh +# on 2026-06-12T17:59:03+03:00. +# +# After applying this patch via cookbook_apply_patches, +# the recipe's [build].script should call: +# REDBEAR_PATCHES_DIR="/home/kellito/Builds/RedBear-OS/local/patches/kf6-kwindowsystem" +# cookbook_apply_patches "${REDBEAR_PATCHES_DIR}" +# in place of the sed -i chains that produced these edits. + +diff -ruN '--exclude=.git' '--exclude=target' '--exclude=.clang-format' '--exclude=.gitignore' /home/kellito/Builds/RedBear-OS/local/recipes/kde/kf6-kwindowsystem//source-pristine/CMakeLists.txt /home/kellito/Builds/RedBear-OS/local/recipes/kde/kf6-kwindowsystem//source/CMakeLists.txt +--- /home/kellito/Builds/RedBear-OS/local/recipes/kde/kf6-kwindowsystem//source-pristine/CMakeLists.txt 2026-06-12 17:58:14.097649577 +0300 ++++ /home/kellito/Builds/RedBear-OS/local/recipes/kde/kf6-kwindowsystem//source/CMakeLists.txt 2026-06-12 17:58:56.877257856 +0300 +@@ -86,7 +86,7 @@ + set(KWINDOWSYSTEM_HAVE_X11 ${KWINDOWSYSTEM_X11}) + + # Subdirectories +-ecm_install_po_files_as_qm(poqm) ++#ecm_install_po_files_as_qm(poqm) + + ecm_set_disabled_deprecation_versions( + QT 6.11.0 diff --git a/local/scripts/migrate-kf6-seds-to-patches.sh b/local/scripts/migrate-kf6-seds-to-patches.sh index 5558b15dfd..bce2833ebb 100755 --- a/local/scripts/migrate-kf6-seds-to-patches.sh +++ b/local/scripts/migrate-kf6-seds-to-patches.sh @@ -179,8 +179,16 @@ for recipe_dir in "${recipe_dirs[@]}"; do timeout 600 ./target/release/repo cook "$name" >>"$log_file" 2>&1 || true # Step 4: diff pristine vs post-cook. + # + # Exclude ECM-generated files that the cmake configure step + # creates on every run: `.clang-format` (clang-format style + # config), `.gitignore` (gitignore rules for the build dir), + # and any `target/` build outputs. These are NOT Red Bear + # edits and would pollute the patch with autogenerated noise. diff_out=$(diff -ruN "$pristine_dir" "$recipe_dir/source" \ - --exclude='.git' --exclude='target' 2>/dev/null || true) + --exclude='.git' --exclude='target' \ + --exclude='.clang-format' --exclude='.gitignore' \ + 2>/dev/null || true) if [ -z "$diff_out" ]; then echo " NOTE: cook produced no diff (sed chains may have been no-ops)" rm -rf "$pristine_dir" diff --git a/local/scripts/tests/test_migrate_kf6_seds.py b/local/scripts/tests/test_migrate_kf6_seds.py index eb51db86a7..54d27821a2 100644 --- a/local/scripts/tests/test_migrate_kf6_seds.py +++ b/local/scripts/tests/test_migrate_kf6_seds.py @@ -219,6 +219,25 @@ class TestScriptStructure(unittest.TestCase): "cook call must be wrapped in `timeout N`", ) + def test_diff_excludes_ecm_generated_files(self): + # ECM (Extra CMake Modules) writes a `.clang-format` + # config file and a `.gitignore` file during the cmake + # configure step on every cook. These are NOT Red Bear + # edits and would pollute the migration patch with + # autogenerated noise (95+ lines for `.clang-format` + # alone). The diff must exclude them. + text = SCRIPT.read_text() + self.assertIn( + ".clang-format", + text, + "diff command must exclude .clang-format (ECM autogenerated)", + ) + self.assertIn( + ".gitignore", + text, + "diff command must exclude .gitignore (ECM autogenerated)", + ) + if __name__ == "__main__": unittest.main()