public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH] deb-dl-dir: Avoid hanging mounts on failed download
@ 2024-10-17  7:57 Anton Mikanovich
  0 siblings, 0 replies; only message in thread
From: Anton Mikanovich @ 2024-10-17  7:57 UTC (permalink / raw)
  To: isar-users; +Cc: Anton Mikanovich

If apt-get fails during debsrc_download execution there will be mount
left behind. Protect it with a trap for cleanup in case of failure.

Signed-off-by: Anton Mikanovich <amikan@ilbers.de>
---
 meta/classes/deb-dl-dir.bbclass | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/meta/classes/deb-dl-dir.bbclass b/meta/classes/deb-dl-dir.bbclass
index 55e56c50..7ebd057e 100644
--- a/meta/classes/deb-dl-dir.bbclass
+++ b/meta/classes/deb-dl-dir.bbclass
@@ -48,6 +48,9 @@ debsrc_download() {
 
     debsrc_do_mounts "${rootfs}"
 
+    trap 'exit 1' INT HUP QUIT TERM ALRM USR1
+    trap 'debsrc_undo_mounts "${rootfs}"' EXIT
+
     ( flock 9
     set -e
     printenv | grep -q BB_VERBOSE_LOGS && set -x
-- 
2.34.1

-- 
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/isar-users/20241017075727.101424-1-amikan%40ilbers.de.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-10-17  7:57 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-10-17  7:57 [PATCH] deb-dl-dir: Avoid hanging mounts on failed download Anton Mikanovich

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