Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: flatpak-builder is happy to delete the current directory #475

Open
2 tasks done
allisonkarlitskaya opened this issue Jun 10, 2022 · 0 comments
Open
2 tasks done

Comments

@allisonkarlitskaya
Copy link

allisonkarlitskaya commented Jun 10, 2022

Checklist

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

flatpak-builder version

flatpak-builder 1.2.2

Flatpak version

Flatpak 1.12.7

How to reproduce

  1. Start in the source directory of the project you're working on
  2. Try to remember how to run flatpak-builder. Something about --force-clean --user --install or so, I think?
  3. See the --help output mentions that you need to give mandatory DIRECTORY and MANIFEST options.
  4. Perhaps having used Docker a couple of times, try giving . for the DIRECTORY argument.

Expected Behavior

A nice message from flatpak-builder saying "refusing to delete the current directory".

Actual Behavior

flatpak-builder did exactly what I told it to. --force-clean . is pretty clear, no?

So maybe this isn't a bug, but it's a big (and destructive) enough trap that's easy enough to fall into that it ought to be forbidden. Maybe it makes sense to build in the current directory, but I can't imagine any situation in which it's reasonable to delete the current directory. flatpak-builder --force-clean . should refuse to operate.

There's precedent for this: even rm -rf prevents you from shooting yourself in the foot in this particular way:

rm: refusing to remove '.' or '..' directory: skipping '.'

Additional Information

Fortunately, I take automated hourly snapshots of my ~/src. Combined with some git show output that happened to be in the terminal backlog I was able to piece everything back together. This time. 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants