From 90119969f5c0d4c34e25ecb3c586b6ce64fecafb Mon Sep 17 00:00:00 2001 From: James Le Cuirot Date: Fri, 9 Jan 2026 10:46:29 +0000 Subject: [PATCH] github: Fix kernel-apply-patch.sh again for other branches The previous fix worked on main, but not on the other branches where hv-daemons-9999.ebuild still exists. The glob was matching more than one ebuild, causing the rename to fail. This change ensures that the glob doesn't match 9999. It will fail if there is still more than one match, but that was the case originally. Bash isn't smart enough to determine the latest version accurately. Finally, it won't run sed if the ebuild is a symlink because doing so would turn it into a regular file. We shouldn't put COREOS_SOURCE_REVISION in symlinked ebuilds. Signed-off-by: James Le Cuirot --- .github/workflows/kernel-apply-patch.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/kernel-apply-patch.sh b/.github/workflows/kernel-apply-patch.sh index aa4844c4a11..6563c0a31df 100755 --- a/.github/workflows/kernel-apply-patch.sh +++ b/.github/workflows/kernel-apply-patch.sh @@ -31,11 +31,14 @@ extra_pkgs=( app-emulation/hv-daemons ) +shopt -s extglob for pkg in sys-kernel/coreos-{sources,modules,kernel} app-emulation/hv-daemons; do pkg+=/${pkg##*/} - git mv "${pkg}"-*.ebuild "${pkg}-${VERSION_NEW}.ebuild" - sed -i -e '/^COREOS_SOURCE_REVISION=/s/=.*/=""/' "${pkg}-${VERSION_NEW}.ebuild" + new=${pkg}-${VERSION_NEW}.ebuild + git mv "${pkg}"-!(9999*).ebuild "${new}" + [[ -L ${new} ]] || sed -i -e '/^COREOS_SOURCE_REVISION=/s/=.*/=""/' "${new}" done +shopt -u extglob # Leave ebuild repo section of SDK popd