Files
RedBear-OS/local/scripts
kellito b8c1c780dc build: ship first C-7 KF6 sed migration patch (kf6-karchive)
First durable artifact from the C-7 KF6 sed migration: the
inline sed -i chains in local/recipes/kde/kf6-karchive's
[build].script have been captured as a durable external
patch in local/patches/kf6-karchive/01-initial-migration.patch.

This patch was generated by running the v2 migration
script (commit 827895d32) against the live kf6-karchive
recipe. The actual sed edits captured are:

  -ecm_install_po_files_as_qm(poqm)
  +#ecm_install_po_files_as_qm(poqm)

The other 3 sed chains in the recipe (ki18n_install(po),
.arg(mode), .arg(d->mode)) were no-ops against the karchive
6.26.0 upstream tar (the target lines either no longer
exist or are already in the desired state in this upstream
version). The migration script correctly captures only the
real edits; no-ops produce no patch hunks.

Script fix in this commit:

The migration script's v2 was producing silently empty
diffs on already-cooked recipes because the cookbook's
`fetch` re-uses an existing source/ tree if it finds one
(it does this to avoid re-extracting tars on every fetch).
For C-7 migration we need the truly pristine upstream
state. The fix:
  1. Add an explicit `unfetch` step BEFORE the `fetch`
     (so the source/ dir is removed before re-extraction)
  2. Set `REDBEAR_ALLOW_LOCAL_UNFETCH=1` because kf6-*
     and qt* recipes are local-overlay recipes under
     local/recipes/, and the cookbook's default policy is
     to never clobber a local-overlay source (the env var
     overrides that policy for the migration's explicit
     unfetch call only)
  3. Apply the same env var to the post-capture `unfetch`
     at the end of the script

The script header documents this cookbook behavior with
inline comments so a future contributor doesn't re-introduce
the silent-failure mode.

Patch filter:

The migration script's diff includes ECM-autogenerated
files like .clang-format that aren't real sed edits. The
captured patch was 122 lines, of which 95 were the
.clang-format autogeneration. The committed patch is the
filtered 24-line version that drops `.clang-format`,
`.gitignore`, and any `target/` artifacts. (A future
script improvement could do this filter inline.)

Test count: 120 -> 122 (2 new tests in test_migrate_kf6_seds.py):
  - test_sets_local_unfetch_env_var: regression guard
    against forgetting the env var
  - test_unfetches_before_fetching: regression guard
    against calling fetch before unfetch (silent-failure
    mode in v2)

Next steps for kf6-karchive specifically (manual, not part
of this commit):
  1. Edit local/recipes/kde/kf6-karchive/recipe.toml's
     [build].script to remove the 4 inline sed -i chains
     and add:
         REDBEAR_PATCHES_DIR="local/patches/kf6-karchive"
         cookbook_apply_patches "${REDBEAR_PATCHES_DIR}"
  2. Cook again to verify the patch + rewritten script
     produce a byte-identical stage.pkgar
  3. Commit the recipe rewrite + the patch together

Verified:
  - The migration ran end-to-end on the live tree
  - The patch applies cleanly to the pristine upstream
  - 122/122 Python tests pass
  - The new test_sets_local_unfetch_env_var and
    test_unfetches_before_fetching both pass

C-7 status: 1 of 56 KF6 sed-bearing recipes migrated.
55 remaining (next: kf6-attica has the smallest sed chain;
after that, breeze, kf6-syntaxhighlighting).
2026-06-12 17:05:46 +03:00
..
2026-05-29 21:59:47 +03:00