From 5f6352ad695a7150fa9f58929faed1c2e6572c15 Mon Sep 17 00:00:00 2001 From: tiffanny29631 Date: Wed, 7 Oct 2026 22:21:44 +0000 Subject: [PATCH] stage_binaries.sh: skip package files that are not on disk Minimal Debian base images (e.g. debian:trixie-slim) use dpkg path-exclude rules (/etc/dpkg/dpkg.cfg.d/) to drop files such as /usr/share/lintian/*, but `dpkg -L` still lists them. stage_one_package() hands those paths to stage_one_file(), which falls through to `cp -lpP` and fails the build: cp: cannot stat '/usr/share/lintian/overrides/base-files': No such file or directory Skip (with a debug log) files from a package manifest that do not exist. Explicitly requested files (-f) and binaries (-b) still go straight to stage_one_file() and fail loudly if missing. Signed-off-by: tiffanny29631 --- stage_binaries.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/stage_binaries.sh b/stage_binaries.sh index 162fcaba6..9c9741dd3 100755 --- a/stage_binaries.sh +++ b/stage_binaries.sh @@ -262,6 +262,12 @@ function stage_one_package() { local pkg="$2" while read -r file; do + # Minimal base images may drop files via dpkg path-exclude rules + # (see /etc/dpkg/dpkg.cfg.d/), but dpkg -L still lists them. + if [[ ! -e "${file}" && ! -L "${file}" ]]; then + DBG "skipping ${file} from pkg ${pkg}: listed by dpkg but not present" + continue + fi indent stage_file_and_deps "${staging}" "${file}" done < <( dpkg -L "${pkg}" \ | grep_allow_nomatch -vE '(/\.|/usr/share/(man|doc|.*-completion))' )