simplepypi icon indicating copy to clipboard operation
simplepypi copied to clipboard

Avoid Package Overwrite

Open lovato opened this issue 9 years ago • 1 comments

I did a cron script to chmod 444 all files inside packages directory. With this, the user get a HTTP 500 if he tries to upload a new package with same name/version.

Obviously, you cannot be root to do that. Root simply ignores 444 for himself.

If after an upload, a chmod can be issued, this kind of solve this, for now. Or a file.exists may solve it too.

What do you think?

Best, Marco

lovato avatar Oct 27 '14 17:10 lovato

Hi @lovato - this was actually intentional. The way we were using simplepypi at work we would sometimes need to re-submit a patched package with the same version number as the unpatched one, and we wanted simplepypi to silently overwrite the old package.

However, I can see why other people would not want that to be the case. If someone wanted to submit a pull request that supported 1) deleting a package and 2) have simplepypi return some sort of sane error when you try to resubmit a package with the same name / version, I think that'd be reasonable way to support both use cases.

steiza avatar Oct 28 '14 14:10 steiza