github: Fix the rust workflow

Replace any dev-lang/rust version with the current one, and make sure
that the modified files in the profiles directory is actually included
in the patch.
This commit is contained in:
Krzesimir Nowak 2021-09-14 18:48:49 +02:00
parent 87e65d16e5
commit b7269c6e12
2 changed files with 7 additions and 2 deletions

View File

@ -40,6 +40,8 @@ function generate_patches() {
CATEGORY_NAME=$1
PKGNAME_SIMPLE=$2
PKGNAME_DESC=$3
shift 3
local dir
pushd "${SDK_OUTER_SRCDIR}/third_party/coreos-overlay" >/dev/null || exit
@ -48,6 +50,9 @@ function generate_patches() {
# We can only create the actual commit in the actual source directory, not under the SDK.
# So create a format-patch, and apply to the actual source.
git add ${CATEGORY_NAME}/${PKGNAME_SIMPLE}
for dir in "$@"; do
git add "${dir}"
done
git commit -a -m "${CATEGORY_NAME}: Upgrade ${PKGNAME_DESC} ${VERSION_OLD} to ${VERSION_NEW}"
# Create a patch for the main ebuilds.

View File

@ -21,7 +21,7 @@ if [[ "${VERSION_NEW}" = "${VERSION_OLD}" ]]; then
fi
# replace rust version in profiles/, e.g. package.accept_keywords.
find profiles -name 'package.*' | xargs sed -i "s/=dev-lang\/rust-${VERSION_OLD}/=dev-lang\/rust-${VERSION_NEW}/"
find profiles -name 'package.*' | xargs sed -i "s/=dev-lang\/rust-\S\+/=dev-lang\/rust-${VERSION_NEW}/"
pushd "dev-lang/rust" >/dev/null || exit
git mv $(ls -1 rust-${VERSION_OLD}.ebuild) "rust-${VERSION_NEW}.ebuild"
@ -29,7 +29,7 @@ popd >/dev/null || exit
popd >/dev/null || exit
generate_patches dev-lang rust dev-lang/rust
generate_patches dev-lang rust dev-lang/rust profiles
apply_patches