Hi again,
I've finally cracked the code !
I finally found out what the difference is, regarding package installs,
between the official and slim images.
Mainly, the existence of this file, which overrides dpkg official
logic:
/etc/dpkg/dpkg.cfg.d/docker
You can check this yourself !
This file is NOT present in the non-slim images (checked on sid and
sid-slim just to be sure as well).
The file does a bunch of wild stuff, mainly telling dpkg (apt backend)
to exclude a bunch of folders and files (through wildcards) from dpkg
installs and configures (mainly /usr/share/doc, locale).
This seems logical for a slimmed down image, but may lead to
inconsistent results. Out of pure curiosity I tried installing some
other random packages I use and, sure enough, one of them failed in a
similar way (failed to cp to /usr/share/doc/<pkg-
name>/examples/config.txt). It was mc or an apache plugin I think.

Anyway, adding this last line with mini-httpd:
root@ef77c06126ea:/etc/dpkg/dpkg.cfg.d# tail -n 1
/etc/dpkg/dpkg.cfg.d/docker
path-include /usr/share/doc/mini-httpd/examples/*

seems to fix it (works as expected).
I see the maintainer of this image did a similar workaround for other
stuff around such as this line:
path-include /usr/share/doc/kde/HTML/C/*

Thus, I propose the easiest fix of adding this to your yaml config file
(I don't have much experience with docker). I still want to ship this
file in the official manner which other packages use, so I'm reluctant
to propose a workaround which is only applicable here. I'm working on
patching some existing C problems which affect all users, currently.
However, if you or anyone else proposes a fix which does not affect
normal operation in the debian:testing docker && plain install use
cases and does not break lintian rules, I'm more than happy to
incorporate it in mini-httpd:1.30-7.

If you find the workaround satisfactory and you need to use the slim
image, please close this bug via bugs.debian.org; if not I'm open to
suggestions and patch proposals.

Thank you for improving the quality of Debian packages !

Alexandru Mihail
mini-httpd maintainer

On Thu, 2024-01-18 at 17:35 +0100, lor...@freenet.de wrote:
> On Thu 2024-01-18 17:17, Alexandru Mihail wrote:
> > Can you replicate the problem by running apt purge mini-httpd &&
> > apt >install mini-httpd ? (docker)
> 
> # docker run -ti --rm debian:testing-slim bash -c "apt-get update &&
> apt-get purge mini-httpd && apt-get install -y mini-httpd
> [...]
> Package 'mini-httpd' is not installed, so not removed
> [...]
> Setting up mini-httpd (1.30-6) ...
> cp: cannot stat '/usr/share/doc/mini-httpd/examples/index.html': No
> such file or directory
> dpkg: error processing package mini-httpd (--configure):
>  installed mini-httpd package post-installation script subprocess
> returned error exit status 1
> Setting up libgdbm6:amd64 (1.23-5) ...
> Setting up libaprutil1:amd64 (1.6.3-1+b1) ...
> Setting up apache2-utils (2.4.58-1+b1) ...
> Processing triggers for libc-bin (2.37-13) ...
> Errors were encountered while processing:
>  mini-httpd
> E: Sub-process /usr/bin/dpkg returned an error code (1)
> 
> 
> > Can you replicate in a non-docker environment (testing or sid) if
> > you have access to one ?
> 
> no, but I can use another base image
> 
> # docker run -ti --rm debian:testing bash -c "apt-get update && apt-
> get install -y mini-httpd"
> 
> this works. The error seems only to happen on debian:testing-slim but
> not on debian:testing

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to