Skip to content

Commit

Permalink
USES=cargo: Fix CARGO_BUILDDEP=any-version
Browse files Browse the repository at this point in the history
Fix update.sh to only replace the first version.
  • Loading branch information
Tobias Kortkamp authored and Tobias Kortkamp committed Nov 8, 2022
1 parent 2f2a8ad commit 922686e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Mk/Uses/cargo.mk
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ CARGO_BUILDDEP?= yes
. if ${CARGO_BUILDDEP:tl} == "yes"
BUILD_DEPENDS+= ${RUST_DEFAULT}>=1.64.0:lang/${RUST_DEFAULT}
. elif ${CARGO_BUILDDEP:tl} == "any-version"
BUILD_DEPENDS+= ${RUST_DEFAULT}>=1.64.0:lang/${RUST_DEFAULT}
BUILD_DEPENDS+= ${RUST_DEFAULT}>=0:lang/${RUST_DEFAULT}
. endif

# Location of toolchain (default to lang/rust's toolchain)
Expand Down
7 changes: 5 additions & 2 deletions lang/rust/update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,11 @@ fetch -qo - https://raw.githubusercontent.com/rust-lang/rust/${new_commit}/src/s
"RUST_BOOTSTRAP_VERSION=\(.compiler.version)"
' | portedit merge -i .

sed -i '' -E -e "s,(\\$\\{RUST_DEFAULT\\}>=).*(:lang/\\$\\{RUST_DEFAULT\\}),\\1${version}\\2," \
../../Mk/Uses/cargo.mk ../../Mk/bsd.gecko.mk
cat <<EOF | sed -i '' -E -f - ../../Mk/Uses/cargo.mk ../../Mk/bsd.gecko.mk
1,/\\$\\{RUST_DEFAULT\\}>=/ {
s,(\\$\\{RUST_DEFAULT\\}>=).*(:lang/\\$\\{RUST_DEFAULT\\}),\\1${version}\\2,
}
EOF

portedit set-version -i "${version}" .
portedit set-version -i "${version}" ../rust-bootstrap
Expand Down

0 comments on commit 922686e

Please sign in to comment.