commit:     90837a13a428c44680785f30d7cc89a3b6ac4886
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sun Mar  8 16:49:41 2026 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sun Mar  8 16:49:41 2026 +0000
URL:        
https://gitweb.gentoo.org/proj/mgorny-dev-scripts.git/commit/?id=90837a13

rdep-fetch-cache: Avoid leaving incomplete files

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 rdep-fetch-cache | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/rdep-fetch-cache b/rdep-fetch-cache
index 459f199..26d585a 100755
--- a/rdep-fetch-cache
+++ b/rdep-fetch-cache
@@ -3,17 +3,17 @@
 # (c) 2020-2024 Michał Górny <[email protected]>
 # SPDX-License-Identifier: GPL-2.0-or-later
 
-mkdir -p "${TMPDIR:-/tmp}"/mgorny-dev-scripts || exit 1
-cd "${TMPDIR:-/tmp}"/mgorny-dev-scripts || exit 1
+set -e -x
+
+mkdir -p "${TMPDIR:-/tmp}"/mgorny-dev-scripts
+cd "${TMPDIR:-/tmp}"/mgorny-dev-scripts
+
+wget -O rdeps.tar.xz https://qa-reports.gentoo.org/output/genrdeps/rdeps.tar.xz
+xz -df rdeps.tar.xz
 
 if command -v lz4 >/dev/null; then
        echo "lz4 available, repacking as rdeps.tar.lz4" >&2
-
-       exec wget -O - 
https://qa-reports.gentoo.org/output/genrdeps/rdeps.tar.xz |
-               xz -cd | lz4 -c > rdeps.tar.lz4
+       lz4 -f --rm rdeps.tar
 else
-       echo "fetching to rdeps.tar (install lz4 to compress)" >&2
-
-       exec wget -O - 
https://qa-reports.gentoo.org/output/genrdeps/rdeps.tar.xz |
-               xz -cd > rdeps.tar
+       echo "fetched to rdeps.tar (install lz4 to compress)" >&2
 fi

Reply via email to