From d304b95beb76fd62ea249357df526fb211426edc Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Fri, 3 Jan 2025 10:20:45 +0100 Subject: [PATCH 1/2] mkosi: Handle directories in debian/not-installed correctly If a directory is specified without a glob pattern, we have to exclude all files in that directory, so add a recursive glob to every directory and enable the bash globstar feature when globbing to '**/*' matches all files and directories beneath the given directory. --- .../build/mkosi.conf.d/debian-ubuntu/mkosi.build.chroot | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mkosi.images/build/mkosi.conf.d/debian-ubuntu/mkosi.build.chroot b/mkosi.images/build/mkosi.conf.d/debian-ubuntu/mkosi.build.chroot index b17483a03f..569bf64499 100755 --- a/mkosi.images/build/mkosi.conf.d/debian-ubuntu/mkosi.build.chroot +++ b/mkosi.images/build/mkosi.conf.d/debian-ubuntu/mkosi.build.chroot @@ -111,8 +111,9 @@ if ! build; then if [[ -f debian/not-installed ]]; then pushd debian/tmp grep --invert-match "^#" ../not-installed | - xargs -I {} bash -O nullglob -c "printf '%s\n' {}" | - sed "/^$/d" | + xargs -I {} sh -c "test -d '{}' && echo '{}/**/*' || echo '{}'" | + xargs -I {} bash -O nullglob -O globstar -c "printf '%s\n' {}" | + sed --expression "/^$/d" --expression "s#//*#/#g" | xargs -I {} sh -c "test -f '{}' && echo '{}' || true" >>/tmp/packaged-files popd fi From e965430f57834d641b0b1327617622c20aa23b70 Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Fri, 3 Jan 2025 11:42:47 +0100 Subject: [PATCH 2/2] mkosi: Warn on unpackaged files in the debian package build --- .../build/mkosi.conf.d/debian-ubuntu/mkosi.build.chroot | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mkosi.images/build/mkosi.conf.d/debian-ubuntu/mkosi.build.chroot b/mkosi.images/build/mkosi.conf.d/debian-ubuntu/mkosi.build.chroot index 569bf64499..9717286586 100755 --- a/mkosi.images/build/mkosi.conf.d/debian-ubuntu/mkosi.build.chroot +++ b/mkosi.images/build/mkosi.conf.d/debian-ubuntu/mkosi.build.chroot @@ -128,6 +128,8 @@ if ! build; then exit 1 fi + echo -e "::warning title=UNPACKAGED-FILES::The following files were not picked up by the package, please update the packaging recipe to include: $(tr '\n' ' ' >debian/systemd.install build