diff --git a/.gitignore b/.gitignore index 0e9f6a0..116f9a6 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ SOURCES/resctl-bench-2.1.2-vendor.tar.gz +SOURCES/resctl-bench-2.1.2.crate diff --git a/.rust-resctl-bench.metadata b/.rust-resctl-bench.metadata index 8bbe261..52fa573 100644 --- a/.rust-resctl-bench.metadata +++ b/.rust-resctl-bench.metadata @@ -1 +1,2 @@ a39a844a6528f45f05bdaea0767fb709960e5b91 SOURCES/resctl-bench-2.1.2-vendor.tar.gz +94dc1777d1f24190683b2385d30f4f864d4a8a56 SOURCES/resctl-bench-2.1.2.crate diff --git a/SOURCES/resctl-bench-2.1.2.crate b/SOURCES/resctl-bench-2.1.2.crate deleted file mode 100644 index 24dbcfe..0000000 Binary files a/SOURCES/resctl-bench-2.1.2.crate and /dev/null differ diff --git a/SOURCES/update-vendor-tarball.sh b/SOURCES/update-vendor-tarball.sh new file mode 100755 index 0000000..34c64dd --- /dev/null +++ b/SOURCES/update-vendor-tarball.sh @@ -0,0 +1,25 @@ +#!/bin/sh + +name='resctl-bench' +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