Skip to content

Commit b3b08e0

Browse files
committed
containerd-apply-patch: updated to work with upstream ebuilds
Signed-off-by: Thilo Fromm <thilofromm@microsoft.com>
1 parent a256fa6 commit b3b08e0

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

.github/workflows/containerd-apply-patch.sh

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,26 @@ fi
2121

2222
# we need to update not only the main ebuild file, but also its CONTAINERD_COMMIT,
2323
# which needs to point to COMMIT_HASH that matches with $VERSION_NEW from upstream containerd.
24-
containerdEbuildOldSymlink=$(get_ebuild_filename app-containers/containerd "${VERSION_OLD}")
25-
containerdEbuildNewSymlink="app-containers/containerd/containerd-${VERSION_NEW}.ebuild"
26-
containerdEbuildMain="app-containers/containerd/containerd-9999.ebuild"
27-
git mv "${containerdEbuildOldSymlink}" "${containerdEbuildNewSymlink}"
28-
sed -i "s/CONTAINERD_COMMIT=\"\(.*\)\"/CONTAINERD_COMMIT=\"${COMMIT_HASH}\"/g" "${containerdEbuildMain}"
29-
sed -i "s/v${VERSION_OLD}/v${VERSION_NEW}/g" "${containerdEbuildMain}"
24+
containerdEbuildOld=$(get_ebuild_filename app-containers/containerd "${VERSION_OLD}")
25+
containerdEbuildNew="app-containers/containerd/containerd-${VERSION_NEW}.ebuild"
26+
git mv "${containerdEbuildOld}" "${containerdEbuildNew}"
27+
sed -i "s/GIT_REVISION=.*/GIT_REVISION=${COMMIT_HASH}/g" "${containerdEbuildNew}"
28+
29+
# The ebuild is masked by default to maintain compatibility with Gentoo upstream
30+
# so we add an unmask for Flatcar only.
31+
keywords_file="profiles/coreos/base/package.accept_keywords"
32+
ts=$(date +'%Y-%m-%d %H:%M:%S')
33+
comment="DO NOT EDIT THIS LINE. Added by containerd-apply-patch.sh on ${ts}"
34+
sed -i "s;^\(=app-containers/containerd\)-${VERSION_OLD} .*;\1-${VERSION_NEW} ~amd64 ~arm64 # ${comment};" "${keywords_file}"
3035

3136
popd
3237

3338
URL="https://github.com/containerd/containerd/releases/tag/v${VERSION_NEW}"
3439

3540
generate_update_changelog 'containerd' "${VERSION_NEW}" "${URL}" 'containerd'
3641

37-
commit_changes app-containers/containerd "${VERSION_OLD}" "${VERSION_NEW}"
42+
# Commit package changes and updated keyword file
43+
commit_changes app-containers/containerd "${VERSION_OLD}" "${VERSION_NEW}" "${keywords_file}"
3844

3945
cleanup_repo
4046

0 commit comments

Comments
 (0)