From a60176a2a9efecdeb9f6b5f6565a7e5ddada3bcc Mon Sep 17 00:00:00 2001 From: Donald Buczek Date: Mon, 4 Nov 2024 09:37:33 +0100 Subject: [PATCH 1/2] beesh: Show downloaded file name after rename Its nicer to have the filename of the downloaded file in the output, for example to copy-and-paste it into tools/srcurl. Move the existing `ls -l` to a point when it already has been renamed from .tmp to its final name. --- src/beesh.sh.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/beesh.sh.in b/src/beesh.sh.in index 8a23688..8d3ddf1 100644 --- a/src/beesh.sh.in +++ b/src/beesh.sh.in @@ -283,13 +283,13 @@ function fetch_one_file() { --timeout=60 \ --tries=1 \ "${url}" - ls -ld "${F}/${file}.tmp" if [ ! -s "${F}/${file}.tmp" ] ; then print_error "ERROR: ${F}/${file}.tmp is empty, download failed." rm "${F}/${file}.tmp" exit 1 fi mv "${F}/${file}.tmp" "${F}/${file}" + ls -ld "${F}/${file}" fi fi From a33bbcbb041f6535da92b6be64393329d103cea0 Mon Sep 17 00:00:00 2001 From: Donald Buczek Date: Mon, 4 Nov 2024 11:03:36 +0100 Subject: [PATCH 2/2] beesh: Allow caller to add wget options When wget is used (by the default bee_download), add options from the variable BEE_WGET_OPTS to the command line. This allows the user to add an authorization header, when the file is pulled from a private repository, for example SRCURL[0]="https://github.molgen.mpg.de/api/v3/repos/mariux64/linux/tarball/mariux-$KERNELVERSION-$PKGREVISION mariux-$KERNELVERSION-$PKGREVISION.tar.gz" BEE_WGET_OPTS=(--header="Authorization: Bearer $(cat ~/.bee_gh_token)") --- src/beesh.sh.in | 1 + 1 file changed, 1 insertion(+) diff --git a/src/beesh.sh.in b/src/beesh.sh.in index 8d3ddf1..b8fadf4 100644 --- a/src/beesh.sh.in +++ b/src/beesh.sh.in @@ -282,6 +282,7 @@ function fetch_one_file() { --output-document="${F}/${file}.tmp" \ --timeout=60 \ --tries=1 \ + "${BEE_WGET_OPTS[@]}" \ "${url}" if [ ! -s "${F}/${file}.tmp" ] ; then print_error "ERROR: ${F}/${file}.tmp is empty, download failed."