I'd move this code out of the `with-no-warnings` block.  It's only needed for the `package-delete` code, and we should keep disabled warnings as limited as possible.