Only attempt removing qemu-user-static for root or unshare mode

This commit is contained in:
Helmut Grohne 2019-08-26 16:34:35 +02:00 committed by Johannes 'josch' Schauer
parent 77f2cbee5d
commit 4f2e655ad5
Signed by untrusted user: josch
GPG key ID: F2CBA5C78FBD83E1

View file

@ -1708,7 +1708,7 @@ sub setup {
rmdir "$options->{root}/var/lib/apt/lists/auxfiles" or die "cannot rmdir /var/lib/apt/lists/auxfiles: $!";
}
if (defined $options->{qemu} and $options->{mode} ne 'proot' and $options->{mode} ne 'fakechroot') {
if (defined $options->{qemu} and any { $_ eq $options->{mode} } ('root', 'unshare')) {
unlink "$options->{root}/usr/bin/qemu-$options->{qemu}-static" or error "cannot unlink /usr/bin/qemu-$options->{qemu}-static: $!";
}