From 4cb45c7d37407a6c562abf8c67c9ed8dcb0fa2c0 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Thu, 15 Jun 2023 18:07:46 +0100 Subject: [PATCH] Copy test/via-cargo-install-in-ci from derive-adhoc.git Signed-off-by: Ian Jackson --- debian/copyright | 30 ++++++++++++++++++++++++++++++ test/via-cargo-install-in-ci | 15 +++++++++++++++ 2 files changed, 45 insertions(+) create mode 100755 test/via-cargo-install-in-ci diff --git a/debian/copyright b/debian/copyright index 25ed3f4..4829929 100644 --- a/debian/copyright +++ b/debian/copyright @@ -88,6 +88,36 @@ arrangements. This is not currently used (or built or installed). Within this directory there is: +test/via-cargo-install-in-ci + + Originally copied from arti.git#7aacbc617ca62b0371a908b5edca9a10aa4d36fa + into derive-adhoc.git, where it was further modified. + We copied from derive-adhoc.git#c33a2b02ce0d2a7e2a318abec50e6eab8e7bf880 + + MIT License + + Copyright 2019-2022, The Tor Project, Inc. + + Permission is hereby granted, free of charge, to any person + obtaining a copy of this software and associated documentation + files (the "Software"), to deal in the Software without + restriction, including without limitation the rights to use, copy, + modify, merge, publish, distribute, sublicense, and/or sell copies + of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + uml/rndaddtoentcnt/ MIT License diff --git a/test/via-cargo-install-in-ci b/test/via-cargo-install-in-ci new file mode 100755 index 0000000..65dded2 --- /dev/null +++ b/test/via-cargo-install-in-ci @@ -0,0 +1,15 @@ +#!/bin/bash + +set -euo pipefail + +cache="$*" +cmd="$1"; shift + +cache="${cache// /,}" +cache="cache/$cache" + +if cp -v "$cache" "$CARGO_HOME"/bin/"$cmd"; then exit 0; fi + +mkdir -p cache +cargo install "$@" "$cmd" +cp -v "$CARGO_HOME/bin/$cmd" "$cache" -- 2.30.2