mirror of
https://github.com/flatcar/scripts.git
synced 2025-08-18 21:11:08 +02:00
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:
parent
87e65d16e5
commit
b7269c6e12
@ -40,6 +40,8 @@ function generate_patches() {
|
|||||||
CATEGORY_NAME=$1
|
CATEGORY_NAME=$1
|
||||||
PKGNAME_SIMPLE=$2
|
PKGNAME_SIMPLE=$2
|
||||||
PKGNAME_DESC=$3
|
PKGNAME_DESC=$3
|
||||||
|
shift 3
|
||||||
|
local dir
|
||||||
|
|
||||||
pushd "${SDK_OUTER_SRCDIR}/third_party/coreos-overlay" >/dev/null || exit
|
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.
|
# 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.
|
# So create a format-patch, and apply to the actual source.
|
||||||
git add ${CATEGORY_NAME}/${PKGNAME_SIMPLE}
|
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}"
|
git commit -a -m "${CATEGORY_NAME}: Upgrade ${PKGNAME_DESC} ${VERSION_OLD} to ${VERSION_NEW}"
|
||||||
|
|
||||||
# Create a patch for the main ebuilds.
|
# Create a patch for the main ebuilds.
|
||||||
|
@ -21,7 +21,7 @@ if [[ "${VERSION_NEW}" = "${VERSION_OLD}" ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# replace rust version in profiles/, e.g. package.accept_keywords.
|
# 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
|
pushd "dev-lang/rust" >/dev/null || exit
|
||||||
git mv $(ls -1 rust-${VERSION_OLD}.ebuild) "rust-${VERSION_NEW}.ebuild"
|
git mv $(ls -1 rust-${VERSION_OLD}.ebuild) "rust-${VERSION_NEW}.ebuild"
|
||||||
@ -29,7 +29,7 @@ popd >/dev/null || exit
|
|||||||
|
|
||||||
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
|
apply_patches
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user