From bc7ce4affc50a8ddebc5bfbf2f2a3425dcb4d2cb Mon Sep 17 00:00:00 2001 From: Johannes Schauer Marin Rodrigues Date: Mon, 23 Oct 2023 10:33:37 +0200 Subject: [PATCH] skip symlink creation if it already exists --- mmdebstrap | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mmdebstrap b/mmdebstrap index ffff237..60b3215 100755 --- a/mmdebstrap +++ b/mmdebstrap @@ -1170,6 +1170,12 @@ sub setup_mounts { ); next; } + if (-e "$options->{root}/dev/$fname") { + warning( + "skipping creation of ./dev/$fname because it" + . " already exists in the target"); + next; + } push @cleanup_tasks, sub { unlink "$options->{root}/dev/$fname" or warning("cannot unlink ./dev/$fname: $!");