chocolatey / docs

https://docs.chocolatey.org - new docs website
Apache License 2.0
156 stars 176 forks source link

Cannot create an empty package to deprecate it #520

Open rgl opened 3 years ago

rgl commented 3 years ago

What You Are Seeing?

While trying to deprecate a package like described at https://docs.chocolatey.org/en-us/community-repository/maintainers/deprecate-a-chocolatey-package#the-solution I found that we cannot package an "empty" package. choco pack refuses to create the package with the error:

Cannot create a package that has no dependencies nor content.
vexx32 commented 3 years ago

Part of those steps are include adding a dependency on the other package you're deprecating in favour of. Does the nuspec you're using declare that dependency?

rgl commented 3 years ago

The idea is to retire the package altogether. The documentation seems to suggest that I need to create an empty package instead of just unlisting all versions:

When a package needs to be deprecated, it needs to be handled in such a way that existing users will continue to be able to use the old package id, but take advantage of the replacement package, if there is one.

BTW, the package I'm talking about is https://community.chocolatey.org/packages/packer-provisioner-windows-update/0.12.0

vexx32 commented 3 years ago

Gotcha. The implication when deprecating a package is that it is usually being deprecated in favour of another package instead; perhaps that could be made more clear in the doc.

For your case, where there isn't a package you're pointing folks to, the better solution would be to unlist the package versions in question, aye. Generally starting from the oldest packages first is recommended; it tends to perform a bit quicker, since the server doesn't need to update which package is considered the latest after each query. 🙂

gep13 commented 2 years ago

Based on conversation with @TheCakeIsNaOH this feels like a documentation issue. As such, I am going to move this to the docs repository.