You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
566 B
26 lines
566 B
#!/bin/sh
|
|
|
|
name='resctl-demo'
|
|
specfile="rust-${name}.spec"
|
|
version=$(rpm -q --qf '%{VERSION}\n' --specfile "$specfile" | head -1)
|
|
nv="${name}-${version}"
|
|
crate="${nv}.crate"
|
|
vendor_tarball="${nv}-vendor.tar.gz"
|
|
|
|
if [ -f "$vendor_tarball" ]; then
|
|
echo "${vendor_tarball} already exists, aborting"
|
|
exit 1
|
|
fi
|
|
|
|
[ -f "$crate" ] || spectool -g "$specfile"
|
|
tardir="$PWD"
|
|
workdir=$(mktemp -d)
|
|
trap 'rm -rf "$workdir"' EXIT
|
|
|
|
tar xvzf "$tardir/$crate" -C "$workdir"
|
|
(cd "${workdir}/${nv}" && \
|
|
cargo vendor && \
|
|
tar cvzf "${tardir}/${vendor_tarball}" vendor/)
|
|
|
|
exit 0
|