From b7269c6e12ae7eb2c88a8bd382042018c93083ba Mon Sep 17 00:00:00 2001 From: Krzesimir Nowak Date: Tue, 14 Sep 2021 18:48:49 +0200 Subject: [PATCH] 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. --- .../third_party/coreos-overlay/.github/workflows/common.sh | 5 +++++ .../coreos-overlay/.github/workflows/rust-apply-patch.sh | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/common.sh b/sdk_container/src/third_party/coreos-overlay/.github/workflows/common.sh index 964b3290c5..c4d2b821af 100644 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/common.sh +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/common.sh @@ -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. diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/rust-apply-patch.sh b/sdk_container/src/third_party/coreos-overlay/.github/workflows/rust-apply-patch.sh index a4855b4ae3..63a3907904 100755 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/rust-apply-patch.sh +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/rust-apply-patch.sh @@ -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