]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
mkosi: Handle directories in debian/not-installed correctly
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Fri, 3 Jan 2025 09:20:45 +0000 (10:20 +0100)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Fri, 3 Jan 2025 11:53:31 +0000 (12:53 +0100)
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.

mkosi.images/build/mkosi.conf.d/debian-ubuntu/mkosi.build.chroot

index b17483a03f9f8a5784732826ffa76ab840ec6fde..569bf644999710816eea2251701720cde392cf85 100755 (executable)
@@ -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