diff --git a/tools/chromeos/setup_cargo b/tools/chromeos/setup_cargo index 99e1cede22..a06388247b 100755 --- a/tools/chromeos/setup_cargo +++ b/tools/chromeos/setup_cargo @@ -6,8 +6,15 @@ # To build crosvm using cargo against libraries and crates provided by ChromeOS # use this script to update path references in Cargo.toml. +set -e + CARGO_PATH=$(dirname "$0")/../../Cargo.toml +if ! git diff "${CARGO_PATH}"; then + echo "There is pending Cargo.toml changes, please clean first." + exit 1 +fi + declare -A replacements=( ["libcras_stub"]="../../third_party/adhd/cras/client/libcras" ["system_api_stub"]="../../platform2/system_api" @@ -20,4 +27,15 @@ for crate in "${!replacements[@]}"; do "${CARGO_PATH}" done -echo "Modified Cargo.toml with new paths. Please do not commit those." +git commit "${CARGO_PATH}" -m 'crosvm: DO NOT SUBMIT: Cargo.toml changes. + +This is for local cargo {build,test} in your CrOS checkout. +Please do not submit this change. + +BUG=None +TEST=None + +Commit: false +' + +echo "Modified Cargo.toml with new paths. Please do not submit the change."