How to remove files from the with override-build?

As title. I have a yaml here that uses a local .deb file, extract it, copies the extracted files in the correct location.

Once the files are copied from opt/fireflyluciferin to the destination folders, I would like to remove the extracted files that are present in opt/fireflyluciferin.

If I add a rm -rf opt/fireflyluciferin at the end of the yaml, I can still see those files in the final build.

Why?

1 Like

I tried adding a cleanup part at the end of the yaml cleanup: after: [fireflyluciferin] plugin: dump source: . override-prime: | rm -rf $SNAPCRAFT_PRIME/opt/fireflyluciferin

but it does not work.

ok this cleanup made the trick, after statement was the most important one here:

  cleanup:
    after: [fireflyluciferin, compiledpackage, alsa-pulseaudio]
    plugin: nil
    source: .
    override-prime: |
      rm -rf $SNAPCRAFT_PRIME/opt/fireflyluciferin
1 Like