Dist::Zilla VCS Opps!

Well in the Dist-Pen today I am going to start to play with linking my Distro back into GitHub.

There are a good number of Dist::Zilla plug-ins to be found in CPAN that work with Git and GitHub in one way or an other. Unfortunately source management and system admiration are skills that I have always lacked, so I am hoping that a few of these plug-ins added to my '.ini' will help me keep my GitHub source both up to date and stop me from making any of the VCS Opps! that I have done in the past.

So to start I installed GitHub on the box where I do my building and replicated my database-accessor GitHub repository, not going to go into that you can find a very good tutorial on that here and most likely in many other that I have not seen.

So usual I want to start with baby steps so the first plug-in I am going to look at for Dist::Zilla is 'Dist::Zilla::plug-in::Git::Check'. This little baby should stop the error, where a bug is found and fixed while working on the release, and then the release is made but the that bug fix is not checked-in and pushed back to GitHub. I do not think I have done this one myself but I have seen it happen on a few projects where there are a number of fingers in the pudding and along the way something got overlooked.

So the first thing to do is add in the plug-in Git::Check in the '.ini' file in the new dir where I have done a checkout of my GitHub repo.


[CheckChangeLog]
[PodWeaver]
[Readme::Brief]
installer = mb
installer = eumm
++[Git::Check] 

This plug-in is suppose to do a check of what I am working with and ensure everything has been checked in and there are on other part missing. So off I go and the first time I try to build I get;

[PkgVersion] existing assignment to $VERSION in lib/Database/Accessor.pm
[PkgVersion] existing assignment to $VERSION in lib/Database/Accessor.pm at /usr/local/lib/perl/5.18.2/Moose/Meta/Method/Delegation.pm line 110.

so with this version of my GiHub code I guess I am a little out of sync with the code I have been working with. After a few minutes of editing and getting a rid of an extra VERSION statement or two, adding in a blank in a brace of '.pm' files I neglected to update and finally deleting a unnecessary file, I had the [PkgVersion] plug-in working.

The next thing I encountered was;


[DZ] attempt to add Makefile.PL multiple times; added by: filename set by GatherDir (Dist::Zilla::plug-in::GatherDir line 225); encoded_content added by GatherDir (Dist::Zilla::plug-in::GatherDir line 226); content set by MakeMaker (Dist::Zilla::plug-in::MakeMaker line 329); content added by MakeMaker (Dist::Zilla::plug-in::MakeMaker line 144)
[DZ] attempt to add LICENSE multiple times; added by: filename set by GatherDir (Dist::Zilla::plug-in::GatherDir line 225); encoded_content added by GatherDir (Dist::Zilla::plug-in::GatherDir line 226); content added by License (Dist::Zilla::plug-in::License line 37)
aborting; duplicate files would be produced at /usr/local/share/perl/5.18.2/Dist/Zilla/App/Command/build.pm line 107.

and checking my GitHub repository I see that I had copies, though they where rater moldy, of both files on GitHub. So I removed those files as the plug-ins I have in my '.ini' file namely [MakeMaker] and [ License] should create them for me.

After that my build did not error which I think is odd as the state of my git is


Changes not staged for commit:
(use "git add/rm ..." to update what will be committed)
(use "git checkout -- ..." to discard changes in working directory)

modified: Changes
deleted: LICENSE
deleted: Makefile.PL
modified: dist.ini
modified: lib/Database/Accessor.pm
modified: lib/Database/Accessor/Constants.pm
modified: lib/Database/Accessor/Types.pm
deleted: lib/Database/Accessor/Types2.pm

Untracked files:
(use "git add ..." to include in what will be committed)

Database-Accessor-0.01.tar.gz
Database-Accessor-0.01/


Maybe I am doing something wrong? So after going over the documentation and reading a few other tutorials it clicked in my little brain that the GIT plug-ins fire mostly after the build when everything is correct and your ready, you release it and the plug-ins will then update your repository.

I guess I am getting ahead of myself as I am in no way ready to to release to CPAN as I have very little POD and a good chuck of present tests fail, well better to put this post series off till a later after I get the distro in order first.

At least I go a few things cleaned up today.

Godzillainsanity.jpg

Leave a comment

About byterock

user-pic Long time Perl guy, a few CPAN mods allot of work on DBD::Oracle and a few YAPC presentations