create an empty /var/lib/dpkg/available as otherwise dpkg fails on package removal

This commit is contained in:
Johannes 'josch' Schauer 2019-01-07 13:16:51 +01:00
parent 1e0b4cb3b0
commit 418b42746e
Signed by untrusted user: josch
GPG key ID: F2CBA5C78FBD83E1

View file

@ -657,6 +657,13 @@ sub setup {
close $fh;
}
# /var/lib/dpkg/available is required to exist or otherwise package
# removals will fail
{
open my $fh, '>', "$options->{root}/var/lib/dpkg/available" or die "failed to open(): $!";
close $fh;
}
if (scalar @{$options->{foreignarchs}} > 0) {
open my $fh, '>', "$options->{root}/var/lib/dpkg/arch" or die "cannot open /var/lib/dpkg/arch: $!";
print $fh "$options->{nativearch}\n";