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] (beta.1) bpt repo import leaks temp files #124

Open
maxtruxa opened this issue May 13, 2022 · 1 comment
Open

[BUG] (beta.1) bpt repo import leaks temp files #124

maxtruxa opened this issue May 13, 2022 · 1 comment
Labels
bug Something isn't working
Milestone

Comments

@maxtruxa
Copy link
Contributor

Playing around with a build from release/1.0.0-beta.1 I noticed that bpt repo import sometimes leaks temporary files in the repo directory:

mkdir repro && cd repro/
bpt new foo --dir=foo --split-src-include=false
bpt repo init ./repo --name test
bpt repo import ./repo foo/
# Now any of the below creates a new `bpt-tmp-*.tgz` in `$repo/pkg/`, each time it's run:
bpt repo import ./repo foo/
bpt repo import ./repo foo/ --if-exists=replace

The reason is that the temporary file is never removed when adding the package to the repository fails.

To prevent the same issue from occuring on invalid package revisions, the check of pkg.id.revision should probably happen before creating the temporary directory.

Possible improvement:
Create temporary files in $repo/tmp/ instead of $repo/pkg/. That way, repository maintenance can include just purging that directory without having to care about the actual names of temporary files.

@vector-of-bool
Copy link
Owner

Ah! You found the same bug I found earlier this week. I haven't pushed the fix yet, but I have fixed this in my local copy. There were/are several issues related to package revisions. It will need more polishing before 1.0.0 stable.

@vector-of-bool vector-of-bool added the bug Something isn't working label May 14, 2022
@vector-of-bool vector-of-bool added this to the Beta 1 milestone May 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants