chiark / gitweb /
Copy test/via-cargo-install-in-ci from derive-adhoc.git
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 15 Jun 2023 17:07:46 +0000 (18:07 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 15 Jun 2023 17:50:40 +0000 (18:50 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
debian/copyright
test/via-cargo-install-in-ci [new file with mode: 0755]

index 25ed3f4abab5b4690fb5c82f233eee04133485ba..4829929e5125ec263cde6cd8a9c7c4cb510463c0 100644 (file)
@@ -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 (executable)
index 0000000..65dded2
--- /dev/null
@@ -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"