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 851f8bb
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions .github/workflows/containerd-apply-patch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,17 @@ 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}"
see -i "s;^\(=app-containers/containerd\)-${VERSION_OLD} .*;\1-${VERSION_NEW} # ${comment};" "${keywords_file}"

popd

Expand Down

0 comments on commit 851f8bb

Please sign in to comment.