File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change 4444 re="$(sed 's/[_-]/[_-]/g' <<< "$PACKAGE")"
4545 sed -i "s/^\($re\)==.*/\1==$VERSION/g" -- requirements*.txt
4646
47- sed -i "s/^\($re\) = \".*\"/\1 = \"$VERSION\"/g" -- rust_snuba/Cargo.toml
47+ # Update Cargo.toml dependencies (format: package = "version")
48+ sed -i "s/^\($re\) = \"[^\"]*\"/\1 = \"$VERSION\"/g" -- rust_snuba/Cargo.toml
49+ # Also handle dependencies with features (format: package = { version = "version", features = [...] })
50+ sed -i "s/^\($re\) = { version = \"[^\"]*\"/\1 = { version = \"$VERSION\"/g" -- rust_snuba/Cargo.toml
51+
52+ # Update Cargo.lock if Cargo.toml was modified
53+ if ! git diff --exit-code -- rust_snuba/Cargo.toml > /dev/null 2>&1; then
54+ cd rust_snuba
55+ # Try updating with underscores (cargo prefers underscores in package names)
56+ CARGO_PACKAGE="$(echo "$PACKAGE" | sed 's/-/_/g')"
57+ if ! cargo update --package "$CARGO_PACKAGE" 2>/dev/null; then
58+ # If that fails, try with the original package name
59+ cargo update --package "$PACKAGE"
60+ fi
61+ cd ..
62+ fi
4863
4964 if git diff --exit-code; then
5065 exit 0
You can’t perform that action at this time.
0 commit comments