Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/2] support/download: catch post-process errors
@ 2023-02-10 22:31 Yann E. MORIN
  2023-02-10 22:31 ` [Buildroot] [PATCH 2/2] support/download: fix the cargo post-process in face of failed vendoring Yann E. MORIN
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Yann E. MORIN @ 2023-02-10 22:31 UTC (permalink / raw)
  To: buildroot; +Cc: Yann E. MORIN, Thomas Petazzoni

Currently, when the post-process helper fails while downloading from
upstream, there is no fallback to the backup mirror.

In case the post-process helper fails, we mut consider that to be a
download failure, so we must bail out as if the download backend itself
did fail, but we fail to do so.

Duplicate the logic we have for the download helper: if the post-process
helper fails, remove the downloaded stuff, and continue on to the next
URI, which will ultimately hit the backup mirror (if one has been
configured).

Reported-by: Peter Korsgaard <peter@korsgaard.com>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
---
 support/download/dl-wrapper | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/support/download/dl-wrapper b/support/download/dl-wrapper
index 09a6ac1f1a..1e8d6058f6 100755
--- a/support/download/dl-wrapper
+++ b/support/download/dl-wrapper
@@ -138,9 +138,15 @@ main() {
         fi
 
         if [ -n "${post_process}" ] ; then
-            "${OLDPWD}/support/download/${post_process}-post-process" \
-                -o "${tmpf}" \
-                -n "${raw_base_name}"
+            if ! "${OLDPWD}/support/download/${post_process}-post-process" \
+                    -o "${tmpf}" \
+                    -n "${raw_base_name}"
+            then
+                # cd back to keep path coherence
+                cd "${OLDPWD}"
+                rm -rf "${tmpd}"
+                continue
+            fi
         fi
 
         # cd back to free the temp-dir, so we can remove it later
-- 
2.25.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-02-28 21:14 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-10 22:31 [Buildroot] [PATCH 1/2] support/download: catch post-process errors Yann E. MORIN
2023-02-10 22:31 ` [Buildroot] [PATCH 2/2] support/download: fix the cargo post-process in face of failed vendoring Yann E. MORIN
2023-02-12  8:45   ` Peter Korsgaard
2023-02-12  8:39 ` [Buildroot] [PATCH 1/2] support/download: catch post-process errors Peter Korsgaard
2023-02-28 21:13 ` Peter Korsgaard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox