crosvm/tools/chromeos/setup_cargo
Dennis Kempin 1dab58a2cf Update all copyright headers to match new style
This search/replace updates all copyright notices to drop the
"All rights reserved", Use "ChromiumOS" instead of "Chromium OS"
and drops the trailing dots.

This fulfills the request from legal and unifies our notices.

./tools/health-check has been updated to only accept this style.

BUG=b:246579983
TEST=./tools/health-check

Change-Id: I87a80701dc651f1baf4820e5cc42469d7c5f5bf7
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3894243
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
2022-09-13 18:41:29 +00:00

42 lines
1.1 KiB
Bash
Executable file

#!/usr/bin/env bash
# Copyright 2021 The ChromiumOS Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#
# 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"
["third_party/minijail"]="../../aosp/external/minijail"
)
for crate in "${!replacements[@]}"; do
echo "Replacing '${crate}' with '${replacements[$crate]}'"
sed -i "s|path = \"${crate}|path = \"${replacements[$crate]}|g" \
"${CARGO_PATH}"
done
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."