diff --git a/.gitignore b/.gitignore index c273060..d88b51b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ -SOURCES/rd-agent-2.1.2-vendor.tar.gz SOURCES/linux-5.8.11.tar.xz +SOURCES/rd-agent-2.1.2-vendor.tar.gz +SOURCES/rd-agent-2.1.2.crate diff --git a/.rust-rd-agent.metadata b/.rust-rd-agent.metadata index 9fec122..f0319bd 100644 --- a/.rust-rd-agent.metadata +++ b/.rust-rd-agent.metadata @@ -1,2 +1,3 @@ -e862cb1a476c73af832e662fe4efa7e94e0e7d2d SOURCES/rd-agent-2.1.2-vendor.tar.gz 3c88f4eb9b877148e02480409aaf8973a22f8f3a SOURCES/linux-5.8.11.tar.xz +e862cb1a476c73af832e662fe4efa7e94e0e7d2d SOURCES/rd-agent-2.1.2-vendor.tar.gz +e7b43a495e83293c2211668c87ffc0b800d08948 SOURCES/rd-agent-2.1.2.crate diff --git a/SOURCES/rd-agent-2.1.2.crate b/SOURCES/rd-agent-2.1.2.crate deleted file mode 100644 index 8b1ba08..0000000 Binary files a/SOURCES/rd-agent-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..189ec61 --- /dev/null +++ b/SOURCES/update-vendor-tarball.sh @@ -0,0 +1,25 @@ +#!/bin/sh + +name='rd-agent' +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