Debian Codegraph @

scripts/dist-vendor.sh

raw symbols SCIP
1 #!/bin/shscip-shell filesystem . . `/bin/sh`.
2 # Since Meson invokes this script as
3 # "/bin/sh .../dist-vendor.sh DIST SOURCE_ROOT" we can't rely on bash features
4 set -eu
5 export DIST="$1"
6 export SOURCE_ROOT="$2"
7
8 cd "$SOURCE_ROOT"
9 mkdirscip-shell system . . mkdir. "$DIST"/.cargo
10 # cargo-vendor-filterer can be found at https://github.com/coreos/cargo-vendor-filterer
11 # It is also part of the Rust SDK extension.
12 cargoscip-shell system . . cargo. vendor-filterer --platform=x86_64-unknown-linux-gnu --platform=aarch64-unknown-linux-gnu > "$DIST"/.cargo/config.toml
13 set -- vendor/gettext-sys/gettext-*.tar.*
14 TARBALL_PATH=$1
15 TARBALL_NAME=$(basenamescip-shell system . . basename. "$TARBALL_PATH")
16 rmscip-shell system . . rm. -f "$TARBALL_PATH"
17 # remove the tarball from checksums
18 cargo_checksum='vendor/gettext-sys/.cargo-checksum.json'
19 tmp_f=$(mktempscip-shell system . . mktemp. --tmpdir='vendor/gettext-sys' -t)
20 jqscip-shell system . . jq. -c "del(.files[\"$TARBALL_NAME\"])" "$cargo_checksum" > "$tmp_f"
21 mvscip-shell system . . mv. -f "$tmp_f" "$cargo_checksum"
22 # Don't combine the previous and this line with a pipe because we can't catch
23 # errors with "set -o pipefail"
24 sedscip-shell system . . sed. -i 's/^directory = ".*"/directory = "vendor"/g' "$DIST/.cargo/config.toml"
25 # Move vendor into dist tarball directory
26 mvscip-shell system . . mv. vendor "$DIST"