From b0efc9aa86538e1ee2fc42014d72fc92fde3a7a1 Mon Sep 17 00:00:00 2001 From: Johannes 'josch' Schauer Date: Mon, 22 Oct 2018 11:36:02 +0200 Subject: [PATCH] also conditionally only act on symlinks if havemknod is false --- mmdebstrap | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/mmdebstrap b/mmdebstrap index 45ff48c..8c5ca85 100755 --- a/mmdebstrap +++ b/mmdebstrap @@ -1057,7 +1057,9 @@ sub setup { } elsif ($type == 1) { # hardlink die "type 1 not implemented"; } elsif ($type == 2) { # symlink - symlink $linkname, "$options->{root}/$fname"; + if (!$options->{havemknod}) { + symlink $linkname, "$options->{root}/$fname" or die "cannot create symlink $fname"; + } } elsif ($type == 3 or $type == 4) { # character/block special if (!$options->{havemknod}) { open my $fh, '>', "$options->{root}/$fname" or die "cannot open $options->{root}/$fname: $!"; @@ -1126,7 +1128,9 @@ sub setup { } elsif ($type == 1) { # hardlink die "type 1 not implemented"; } elsif ($type == 2) { # symlink - unlink "$options->{root}/$fname" or die "cannot unlink $fname: $!"; + if (!$options->{havemknod}) { + unlink "$options->{root}/$fname" or die "cannot unlink $fname: $!"; + } } elsif ($type == 3 or $type == 4) { # character/block special if (!$options->{havemknod}) { if ($options->{mode} eq 'unshare') {