I'm using Module::Build
's share_dir
option to install read-only supplementary content when users install my Perl module.
How do I ensure that the old content added by previous versions of my module is deleted when a new version of my module is installed?
Thanks in advance for your help.
Yanick Champoux has recently been dealing with this problem. To do so he has created File::ShareDir::Tarball and its Dist::Zilla counterpart Dist::Zilla::Plugin::ShareDir::Tarball. The idea is that your entire sharedir is tarred so that it is only one directory. Then when your module is upgraded, the tarball is replaced and it is in the state you expect.