1 Commits
Author SHA1 Message Date
clawbot 42e06bf298 Quiet the update-alternatives man page warnings in the image build (closes #222) (#226)
check / check (push) Successful in 5m24s
xz-utils, which nix-bin depends on, links its man pages with update-alternatives when it installs, and the image's dpkg config drops man pages, so each link printed a warning. A config file re-includes only the man1 pages for this install; the same step deletes them, their dangling links in /etc/alternatives and the config file. No man page or package is added or removed.

Model: deepseek-v4-pro
2026-11-07 15:21:18 +01:00
+8 -15
View File
@@ -137,25 +137,18 @@ RUN mkdir /etc/sysusers.d \
# them over plain HTTP and checks each one against the archive's signed
# package lists, so no CA certificates are needed.
#
# The image's dpkg config drops man pages as each package unpacks, so
# xz-utils' install, which nix-bin depends on, prints an update-alternatives
# warning for every man-page link it cannot make. This side file re-includes
# them for this install alone; it is read after /etc/dpkg/dpkg.cfg.d/excludes,
# so it overrides the drop and the links are made quietly. The cleanup below
# removes the man pages and the links and directories they added, then puts
# the base image's empty man directories back. The image holds exactly what
# it held before, and installs built from it still drop man pages.
RUN find /usr/share/man -mindepth 1 -type d > /tmp/base-man-dirs \
&& echo 'path-include=/usr/share/man/*' > /etc/dpkg/dpkg.cfg.d/z-man \
# nix-bin depends on xz-utils, whose install links man pages with
# update-alternatives. The image's dpkg config drops man pages, so each
# link warns. z-man, read after /etc/dpkg/dpkg.cfg.d/excludes, re-includes
# the man1 pages for this install alone; the same step deletes them again,
# so no man page or package is added.
RUN echo 'path-include=/usr/share/man/man1/*' > /etc/dpkg/dpkg.cfg.d/z-man \
&& apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install --yes --no-install-recommends \
ca-certificates nix-bin runit \
&& rm -rf /var/lib/apt/lists/* /etc/dpkg/dpkg.cfg.d/z-man \
&& find /usr/share/man ! -type d -delete \
&& find /etc/alternatives -type l -xtype l -delete \
&& find /usr/share/man -mindepth 1 -type d -empty -delete \
&& xargs -a /tmp/base-man-dirs mkdir -p \
&& rm /tmp/base-man-dirs
&& find /usr/share/man/man1 ! -type d -delete \
&& find /etc/alternatives -type l -xtype l -delete
# Nix run by root expects a group of build users, which nix-bin does not
# create; with the setting empty, root's builds run without them.