Files
RedBear-OS/local/scripts
vasilito aa082b155c C-7: complete KF6 sed-to-patch migration (16 of 17 recipes)
This commit closes the C-7 inline-sed-to-external-patch
arc for all 17 KF6 recipes whose upstream 6.26.0 still
contains the ecm_install_po_files_as_qm call. 16 of 17
now have a durable external patch in
`local/patches/<name>/01-initial-migration.patch`. The
17th, kf6-kbookmarks, is a no-op (line is absent from
upstream 6.26.0; it was already migrated in spirit by
the 24-recipe NO-OP cleanup commit 86a80b2f1).

Patches ship in this commit:
  kf6-karchive (regenerated with new script)
  kf6-kauth
  kf6-kcodecs
  kf6-kcompletion
  kf6-kconfig
  kf6-kcoreaddons
  kf6-kdbusaddons
  kf6-kglobalaccel
  kf6-kitemviews
  kf6-kjobwidgets
  kf6-knotifications
  kf6-kwidgetsaddons
  kf6-kwindowsystem (regenerated with new script)
  kf6-solid
  kf6-sonnet
  kf6-syntaxhighlighting

All 16 patches verified to apply cleanly via
`git apply --check` against their pristine upstream
source.

New helper: `local/scripts/migrate-kf6-seds-direct.sh`
Why: the original `migrate-kf6-seds-to-patches.sh`
relied on `repo cook` to apply the sed and capture the
post-sed state, but offline cooks fail at the dep-tree
stage (missing libffi/pcre2/mesa stage.pkgar) before
reaching the recipe's [build].script. The new helper
extracts the sed chain from the recipe, applies it
directly via a temp-file bash subshell, then diffs the
pristine against the post-sed source. No cook required.

Bugs found and fixed during the new script's
development (all documented in the script):

  1. Bash `$(...)` strips trailing newlines, breaking
     multi-line `sed -i ... \\` continuations. Fix:
     write the chain to a temp file and source it.

  2. `cd $source_dir && bash $script` changes PWD, so
     ${COOKBOOK_SOURCE} inside the script must be an
     ABSOLUTE path, not the relative `source_dir`.

  3. `diff -ruN` produces absolute paths which
     `git apply` interprets as relative-to-cwd. Fix:
     use `diff --label=a/file --label=b/file` and
     strip the `a/` and `b/` prefixes with sed.

  4. `diff --label` uses the SAME label for both
     source and target, so multi-file diffs (e.g.
     kf6-kjobwidgets with both CMakeLists.txt and
     src/CMakeLists.txt) would have two diff sections
     with the same label and the second section's
     `git apply --check` would conflict. Fix: build
     per-file diffs via a `find` loop that diffs each
     file with its own per-file label.

  5. sed with `-E` and the `#` delimiter fails on
     the `;` between two s-expressions. Fix: use
     `-e 's#...#...#' -e 's#...#...#'` instead of
     `-E 's#...#...#; s#...#...#'`.

  6. `patch -p1 --dry-run` cannot apply patches with
     absolute paths. The script's pre-existing
     verification used the wrong tool. Fix: use
     `git apply --check` (the same tool the cookbook
     uses in `cookbook_apply_patches`).

  7. Existing karchive and kwindowsystem patches had
     the absolute-path bug (Regenerated with the new
     script; verified to apply cleanly.)

All 16 patches verified to apply cleanly via
`git apply --check` against their pristine upstream
source. Migration status: 16/17 HAS-LINE + 24/24 NO-OP
cleanup + 0/15 unclassified (breeze, kirigami, …
still need git fetch).
2026-06-12 20:11:29 +03:00
..
2026-05-29 21:59:47 +03:00