forked from josch/mmdebstrap
also conditionally only act on symlinks if havemknod is false
This commit is contained in:
parent
3c48bce2b2
commit
b0efc9aa86
1 changed files with 6 additions and 2 deletions
|
@ -1057,7 +1057,9 @@ sub setup {
|
||||||
} elsif ($type == 1) { # hardlink
|
} elsif ($type == 1) { # hardlink
|
||||||
die "type 1 not implemented";
|
die "type 1 not implemented";
|
||||||
} elsif ($type == 2) { # symlink
|
} 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
|
} elsif ($type == 3 or $type == 4) { # character/block special
|
||||||
if (!$options->{havemknod}) {
|
if (!$options->{havemknod}) {
|
||||||
open my $fh, '>', "$options->{root}/$fname" or die "cannot open $options->{root}/$fname: $!";
|
open my $fh, '>', "$options->{root}/$fname" or die "cannot open $options->{root}/$fname: $!";
|
||||||
|
@ -1126,7 +1128,9 @@ sub setup {
|
||||||
} elsif ($type == 1) { # hardlink
|
} elsif ($type == 1) { # hardlink
|
||||||
die "type 1 not implemented";
|
die "type 1 not implemented";
|
||||||
} elsif ($type == 2) { # symlink
|
} elsif ($type == 2) { # symlink
|
||||||
|
if (!$options->{havemknod}) {
|
||||||
unlink "$options->{root}/$fname" or die "cannot unlink $fname: $!";
|
unlink "$options->{root}/$fname" or die "cannot unlink $fname: $!";
|
||||||
|
}
|
||||||
} elsif ($type == 3 or $type == 4) { # character/block special
|
} elsif ($type == 3 or $type == 4) { # character/block special
|
||||||
if (!$options->{havemknod}) {
|
if (!$options->{havemknod}) {
|
||||||
if ($options->{mode} eq 'unshare') {
|
if ($options->{mode} eq 'unshare') {
|
||||||
|
|
Loading…
Reference in a new issue