Package: mmdebstrap
Version: 1.5.7-3
Severity: normal
X-Debbugs-Cc: [email protected]

If you run mmdebstrap with `--dpkgopt=file`, and `file` does not end in
a newline, mmdebstrap gives this warning:

Filehandle $fh opened only for input at /usr/bin/mmdebstrap line 5669, <$fh> 
line 1.

This comes from the following code:

        'dpkgopt=s'        => sub {
            my ($opt_name, $opt_value) = @_;
            if (-r $opt_value) {
                open my $fh, '<', $opt_value
                  or error "failed to open $opt_value: $!";
                $options->{dpkgopts} .= do { local $/; <$fh> };
                if ($options->{dpkgopts} !~ /\n$/) {
                    print $fh "\n";
                }
                close $fh;

This is trying to write a newline to $fh, which is open for input. It
should be appending to $options->{dpkgopts} instead.

The same bug exists for `--aptopt=file`.

I'll send a patch on salsa.

-- System Information:
Debian Release: forky/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: arm64

Kernel: Linux 6.19.10+deb14-amd64 (SMP w/12 CPU threads; PREEMPT)
Locale: LANG=C.UTF-8, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages mmdebstrap depends on:
ii  apt      3.1.16
ii  perl     5.40.1-7
ii  python3  3.13.9-3

Versions of packages mmdebstrap recommends:
ii  arch-test            0.22-1.1
ii  gpg                  2.4.9-4
pn  libdistro-info-perl  <none>
ii  libdpkg-perl         1.23.7
ii  mount                2.41.3-4
pn  uidmap               <none>

Versions of packages mmdebstrap suggests:
pn  apt-transport-tor                    <none>
ii  apt-utils                            3.1.16
ii  bzip2                                1.0.8-6+b1
ii  ca-certificates                      20260223
pn  debootstrap                          <none>
ii  distro-info-data                     0.68
ii  dpkg-dev                             1.23.7
ii  e2fsprogs                            1.47.4-1
pn  fakechroot                           <none>
ii  fakeroot                             1.37.2-1
pn  genext2fs                            <none>
ii  libarchive13t64 [libarchive13]       3.8.5-1
ii  lz4                                  1.10.0-8
ii  lzop                                 1.04-2
pn  ncompress                            <none>
pn  perl-doc                             <none>
ii  qemu-user                            1:10.2.2+ds-1
ii  qemu-user-binfmt [qemu-user-static]  1:10.2.2+ds-1
pn  squashfs-tools-ng                    <none>
ii  systemd                              260.1-1
ii  xz-utils                             5.8.2-2
ii  zstd                                 1.5.7+dfsg-3+b1

-- no debconf information

Reply via email to