Re: Stow 2.0.x release requirements

Adam Spiers <[email protected]> Sun, 20 Nov 2011 11:29:28 +0000
Newsgroups gmane.comp.gnu.stow.devel
Message-ID <CAOkDyE_UmJxLBxiiU6aHXjoqfjz6b83Loq3tANUU_OSYb6EO-A@mail.gmail.com>
Hi again all,

Good news!  I've finished split the core code off into two new
modules: Stow.pm and Stow/Util.pm.  I'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.

    my $stow =3D new Stow(%$options);

    $stow->plan_unstow(@pkgs_to_unstow);
    $stow->plan_stow  (@pkgs_to_stow);

    my @conflicts =3D $stow->get_conflicts;
    $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.  This made for cleaner tests -
reset_state() is now obsolete, since to reset state you simply
instantiate a new Stow object.

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 :-)

Latest code is available here:

    https://github.com/aspiers/stow/

Final items remaining on my TODO:

  - Fix the below issue with 'make install'

 =A0- Add my support for ignore list files. =A0I might send a separate
 =A0 =A0mail to this list about the design.

 =A0- (Maybe) port my conflict resolution code over.

and also adding Module::Build support so that we can easily make CPAN
releases.  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.  Module::Build expects them
to be under lib/, but if I put this in Makefile.am:

  pmdir =3D $(libdir)/perl5
  nobase_pm_DATA =3D lib/Stow.pm lib/Stow/Util.pm

then autotools installs them to lib/perl5/lib/Stow* which is not
right :-/

Cheers,
Adam