skip symlink creation if it already exists

This commit is contained in:
Johannes Schauer Marin Rodrigues 2023-10-23 10:33:37 +02:00
parent 199e577757
commit bc7ce4affc
Signed by: josch
GPG key ID: F2CBA5C78FBD83E1

View file

@ -1170,6 +1170,12 @@ sub setup_mounts {
); );
next; 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 { push @cleanup_tasks, sub {
unlink "$options->{root}/dev/$fname" unlink "$options->{root}/dev/$fname"
or warning("cannot unlink ./dev/$fname: $!"); or warning("cannot unlink ./dev/$fname: $!");