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()