From 0a7def52d7d57a673dce919f65bab2f6bfeb3b41 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Mon, 17 Jun 2024 15:58:16 -0500 Subject: [PATCH] Teach setupfor to cope if tarball doesn't extract to package name. --- mkroot/packages/plumbing | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mkroot/packages/plumbing b/mkroot/packages/plumbing index e72247c0..306f4854 100755 --- a/mkroot/packages/plumbing +++ b/mkroot/packages/plumbing @@ -31,7 +31,9 @@ setupfor() { if [ -d "$DOWNLOAD/$PACKAGE" ]; then cp -la "$DOWNLOAD/$PACKAGE/." "$PACKAGE" && cd "$PACKAGE" || exit 1 else - tar xvaf "$DOWNLOAD/$PACKAGE"-*.t* && cd "$PACKAGE"-* || exit 1 + local DIR=$(mktemp -dp.) + tar xvafC "$DOWNLOAD/$PACKAGE"-*.t* "$DIR" && + mv "$DIR"/* "$PACKAGE" && rmdir "$DIR" && cd "$PACKAGE" || exit 1 fi } -- 2.39.2