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.
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user