Skip Menu |

This queue is for tickets about the File-Sharedir-Install CPAN distribution.

Report information
The Basics
Id: 92084
Status: open
Priority: 0/
Queue: File-Sharedir-Install

People
Owner: Nobody in particular
Requestors: dmuey [...] cpan.org
ether [...] cpan.org
Cc: LEONT [...] cpan.org
AdminCc:

Bug Information
Severity: Wishlist
Broken in: (no value)
Fixed in: (no value)



Subject: option to remove installed share files that were removed from the dist
It'd be nice to be able to cleanup the installed sharedir so that old files are removed. For example: v0.01 of our module installed …/foo …/bar …/baz v0.02 of our module has: an updated …/foo, the same …/bar, removes …/baz, and a new file …/wop When installing v0.02 on top of the old v0.01: ok: …/foo is updated ok: …/bar remains the same ok: …/wop is installed eek: …/baz still exists! It could be as simple as a bulk cleanup first (e.g. File::Path::Tiny::empty_dir($share_dir)). or a comparison of the installed dir against the dist dir to find what was removed in the dist dir and only remove those. Thanks!
Thanks for the suggestion. This would definately be useful. I'll see if I can work on it soon. One thing is that auto-cleaning the installed directory is a bad idea. Those files might have been changed and those changes pertinent. I'm thinking of "delete-missing" option (remove everything not in the distro, changes are kept), "clean-first" (delete installed directory, all changes are lost) and "was-removed" (list of things to be deleted fron installed directory). It's been a while since I wrote this module so I'll have to remember the base assumptions.
I have uploaded version 0.07. It includes a delete_share() function which should do all that you need. Please tell me what you think.
On Fri Jan 17 14:05:27 2014, GWYN wrote: Show quoted text
> I have uploaded version 0.07. It includes a delete_share() function > which should do all that you need. > > Please tell me what you think.
cool, thanks! will check it out as soon as it shows up on whatever mirror I am hitting :)
On Fri Jan 17 15:29:34 2014, DMUEY wrote: Show quoted text
> On Fri Jan 17 14:05:27 2014, GWYN wrote:
> > I have uploaded version 0.07. It includes a delete_share() function > > which should do all that you need. > > > > Please tell me what you think.
> > cool, thanks! will check it out as soon as it shows up on whatever > mirror I am hitting :)
Looks like it will do the trickthanks! One question: The POD describes Maekfile.PL usage pretty clearly : delete_share '.'; # delete it all first install_share 'share'; # install the current version second but I’m not sure how it might be used w/ Module::Build (since hash order is arbitrary) my $builder = Module::Build->new( … delete_share => '.', install_share => 'share', … ); will that do the delete first then the install? thanks!
Show quoted text
> my $builder = Module::Build->new( > … > delete_share => '.', > install_share => 'share', > … > ); > > will that do the delete first then the install?
As you state, it will be random. I'd really like to say "not my problem." I dislike Module::Build. I dislike it more that it's causing this problem. That said, is it possible to call $builder->add( delete_share => '.'), then $builder->add( 'install_share' => 'share' ) and have it run in order?
You're going to have to help me. I don't see how you get from Module::Build to File::Sharedir::Install. I see Module::Build::Functions::install_share, but that doesn't use my code.
On Fri Jan 17 17:22:10 2014, DMUEY wrote: Show quoted text
> Looks like it will do the trickthanks! One question: > > The POD describes Maekfile.PL usage pretty clearly : > delete_share '.'; # delete it all first > install_share 'share'; # install the current version second > > but I’m not sure how it might be used w/ Module::Build (since hash > order is arbitrary) > > my $builder = Module::Build->new( > … > delete_share => '.', > install_share => 'share', > … > ); > > will that do the delete first then the install?
Module::Build doesn't use File::ShareDir::Install, but implements it on its own. So it will need its own implementation of delete_share too. Leon
Subject: Re: [rt.cpan.org #92084] option to remove installed share files that were removed from the dist
Date: Mon, 20 Jan 2014 15:22:11 -0800
To: Leon Timmermans via RT <bug-File-Sharedir-Install [...] rt.cpan.org>
From: Karen Etheridge <ether [...] cpan.org>
On Mon, Jan 20, 2014 at 03:02:04PM -0500, Leon Timmermans via RT wrote: Show quoted text
> Module::Build doesn't use File::ShareDir::Install, but implements it on its own. So it will need its own implementation of delete_share too.
or possibly changed so it does use File::ShareDir::Install?
Le Lun 20 Jan 2014 18:22:25, ETHER a écrit : Show quoted text
> or possibly changed so it does use File::ShareDir::Install?
If/when that happens, we could create a syntax like : install_share => [ '-.', 'share' ] The - would be a delete, no minus would be install.
Sorry for the delay! Thank you again :) I misunderstood the relationship w/ Module::Build since it used the same name. I created rt 92863 for M::B. thank you again
On Fri Jan 17 14:05:27 2014, GWYN wrote: Show quoted text
> I have uploaded version 0.07. It includes a delete_share() function > which should do all that you need. > > Please tell me what you think.
I'm pretty sure that doesn't do the right thing. It deletes the staging area in blib/, not any installed files. As it stands now, it's pretty much a no-op. Leon
On 2014-02-09 14:05:46, LEONT wrote: Show quoted text
> I'm pretty sure that doesn't do the right thing. It deletes the > staging area in blib/, not any installed files. As it stands now, it's > pretty much a no-op.
I just ran into this after a new version of my distribution restructured the layout in its share/ directory. Clearly the test is not testing the install directory like it should :)