flatpak-builder icon indicating copy to clipboard operation
flatpak-builder copied to clipboard

[Bug]: `cleanup` directive in manifest does not delete directories ending with `/`

Open Yvan-Masson opened this issue 2 years ago • 0 comments

Checklist

  • [X] I agree to follow the Code of Conduct that this project adheres to.
  • [X] I have searched the issue tracker for a bug that matches the one I want to file, without success.

flatpak-builder version

1.2.2

Flatpak version

1.12.7

How to reproduce

Take a sample manifest like this one (which is missing here required dependencies to speed up build):

app-id: fr.masson_informatique.WhosWho
runtime: org.gnome.Platform
runtime-version: '42'
sdk: org.gnome.Sdk
command: whoswho
cleanup:
  - "/bin/"
finish-args:
  - --share=ipc
  - --socket=fallback-x11
  - --socket=wayland
  - --talk-name=org.gtk.vfs.*
  - --filesystem=xdg-run/gvfsd

modules:
  - name: WhosWho
    buildsystem: simple
    build-commands:
      - ./build-translations.py
      - pip3 install --prefix=${FLATPAK_DEST} --no-deps .
    sources:
      - type: archive
        url: https://framagit.org/Yvan-Masson/WhosWho/-/archive/v1.4/WhosWho-v1.4.tar.gz
        sha256: e022b5053c41cf3e70d78ccc695983a5a1bfebf696b4d54a3dad4a2d02df8199

Note that removing /bin in cleanup is again just for the test.

Expected Behavior

Directory /bin should be deleted.

Actual Behavior

In this case /bin/ is not deleted. However, if you remove the trailing /, it is.

Additional Information

No response

Yvan-Masson avatar Jun 14 '22 20:06 Yvan-Masson