Re: Stow 2.0.x release requirements

Adam Spiers <[email protected]> Wed, 23 Nov 2011 13:20:28 +0000
Newsgroups gmane.comp.gnu.stow.devel
Message-ID <CAOkDyE87Nr8S5EU-8zCHGfmRU5rVvZ_0K380eeazvCUuo61VDA@mail.gmail.com>
On Wed, Nov 23, 2011 at 12:02 AM, Kahlil Hodgson <[email protected]> wrot=
e:
> Hi Adam,
>
> On 20/11/11 22:29, Adam Spiers wrote:
>> Good news! =A0I've finished split the core code off into two new
>> modules: Stow.pm and Stow/Util.pm. =A0I'm quite pleased that the process
>> of separating the frontend from the backend seems to have resulted in
>> some nice clean code - hope you agree when you see it.
>>
>> Stow.pm provides a nice object-oriented interface, e.g.
>>
>> =A0 =A0 my $stow =3D new Stow(%$options);
>>
>> =A0 =A0 $stow->plan_unstow(@pkgs_to_unstow);
>> =A0 =A0 $stow->plan_stow =A0(@pkgs_to_stow);
>>
>> =A0 =A0 my @conflicts =3D $stow->get_conflicts;
>> =A0 =A0 $stow->process_tasks() unless @conflicts;
>>
>> This enabled a *huge* reduction in the number of global variables.
>> All the options and state (@Tasks, @Conflicts etc.) are now stored
>> inside a Stow object instance. =A0This made for cleaner tests -
>> reset_state() is now obsolete, since to reset state you simply
>> instantiate a new Stow object.
>
> Very Nice :-)
>
>> After modifying the whole test suite to this new interface, I was able
>> to introduce 'use strict' and 'use warnings' to all the tests, and
>> 'make test' now passes 100% again :-)
>
> Excellent!
>
>> Latest code is available here:
>>
>> =A0 =A0 https://github.com/aspiers/stow/
>
> Hope to get a chance to check it out soon. =A0A little busy with work ATM=
.

I've made a lot more progress since the last mail.  Now I have a
comprehensive ignore files system (including new documentation and
tests) almost ready - just need to tweak the file syntax a bit.

>> and also adding Module::Build support so that we can easily make CPAN
>> releases.
>
> There be dragons.

The dragons are already slain - I've done this :)

>=A0The older MakeMaker stuff may be easier.

I have experience with both systems but I deliberately chose
Module::Build because (a) it autogenerates a Build script rather than
a Makefile and so doesn't clash with autotools, and (b) it seems to be
a cleaner approach overall (I attended a talk by the author years ago)
which I find pretty easy to use.

>> I'm hoping that this will co-exist peacefully with the
>> autotools-based build system, although I'm currently puzzling over how
>> to cope with installation of the modules. =A0Module::Build expects them
>> to be under lib/, but if I put this in Makefile.am:
>>
>> =A0 pmdir =3D $(libdir)/perl5
>> =A0 nobase_pm_DATA =3D lib/Stow.pm lib/Stow/Util.pm
>>
>> then autotools installs them to lib/perl5/lib/Stow* which is not
>> right :-/
>
> Getting the original autotools stuff to work really did my head in. =A0Ha=
d
> to read a lot of documentation just to do something very simple.
> I believe I may have forgotten almost everything I once new about the
> autotools framework now :-(

Don't worry - I already figured it all out.  I'll continue to upload
to my github until either Troy reappears or someone can give me
co-maintainer access.  I'm also pretty much ready to upload to CPAN
but am not sure whether that would be good etiquette before being
"officially" recognised as co-maintainer.