Skip to content

Commit

Permalink
containerd-apply-patch: updated to work with upstream ebuilds
Browse files Browse the repository at this point in the history
Signed-off-by: Thilo Fromm <thilofromm@microsoft.com>
  • Loading branch information
t-lo committed Nov 3, 2023
1 parent a256fa6 commit b3b08e0
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions .github/workflows/containerd-apply-patch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,26 @@ fi

# we need to update not only the main ebuild file, but also its CONTAINERD_COMMIT,
# which needs to point to COMMIT_HASH that matches with $VERSION_NEW from upstream containerd.
containerdEbuildOldSymlink=$(get_ebuild_filename app-containers/containerd "${VERSION_OLD}")
containerdEbuildNewSymlink="app-containers/containerd/containerd-${VERSION_NEW}.ebuild"
containerdEbuildMain="app-containers/containerd/containerd-9999.ebuild"
git mv "${containerdEbuildOldSymlink}" "${containerdEbuildNewSymlink}"
sed -i "s/CONTAINERD_COMMIT=\"\(.*\)\"/CONTAINERD_COMMIT=\"${COMMIT_HASH}\"/g" "${containerdEbuildMain}"
sed -i "s/v${VERSION_OLD}/v${VERSION_NEW}/g" "${containerdEbuildMain}"
containerdEbuildOld=$(get_ebuild_filename app-containers/containerd "${VERSION_OLD}")
containerdEbuildNew="app-containers/containerd/containerd-${VERSION_NEW}.ebuild"
git mv "${containerdEbuildOld}" "${containerdEbuildNew}"
sed -i "s/GIT_REVISION=.*/GIT_REVISION=${COMMIT_HASH}/g" "${containerdEbuildNew}"

# The ebuild is masked by default to maintain compatibility with Gentoo upstream
# so we add an unmask for Flatcar only.
keywords_file="profiles/coreos/base/package.accept_keywords"
ts=$(date +'%Y-%m-%d %H:%M:%S')
comment="DO NOT EDIT THIS LINE. Added by containerd-apply-patch.sh on ${ts}"
sed -i "s;^\(=app-containers/containerd\)-${VERSION_OLD} .*;\1-${VERSION_NEW} ~amd64 ~arm64 # ${comment};" "${keywords_file}"

popd

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

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

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

cleanup_repo

Expand Down

0 comments on commit b3b08e0

Please sign in to comment.