Skip to contentSkip to conversation

support/download: catch post-process errors

Buildroot Peter Korsgaard 1 participant 1 message Feb 12, 2023

lore
Share & tools
lore
#0 lore raw

commit: https://git.buildroot.net/buildroot/commit/?id=a39116b5dba6cf0695620e2ba5302f21fa80a4a5
branch: https://git.buildroot.net/buildroot/commit/?id=refs/heads/master

Fixes:
http://autobuild.buildroot.net/results/12a/12a63ae177fe3ed0c9a1ef2fa01870f334f36b0f/

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 must 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).

---
 support/download/dl-wrapper | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
support/download/dl-wrapper +9 -3
index 09a6ac1f1a..1e8d6058f6 100755
@@ -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

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot