Thank you so much for taking the time to trawl through my output and spot that.
Removed that from the PERL_CPANM_OPT and successfully installed and perldoc'd a new module.
As always ... it was down to me doing something daft.
]]>
➔ env |grep -i perl
MANPATH=/Users/c.wright/perl5/perlbrew/perls/perl-5.20.0/man:/usr/share/man:/usr/local/share/man:/usr/local/git/share/man
PERLBREW_VERSION=0.69
PERLBREW_PERL=perl-5.20.0
PERLBREW_BASHRC_VERSION=0.69
PERLBREW_ROOT=/Users/c.wright/perl5/perlbrew
PATH=/Users/c.wright/perl5/perlbrew/bin:/Users/c.wright/perl5/perlbrew/perls/perl-5.20.0/bin:/Users/c.wright/.vim/bin:/Users/c.wright/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin:/usr/local/go/bin:/usr/local/munki:/Users/c.wright/go/bin
PERLBREW_HOME=/Users/c.wright/.perlbrew
PERL_CPANM_OPT=--local-lib ~/perl5 --mirror http://cpanmirror.wtf.nap --mirror-only
PERLBREW_MANPATH=/Users/c.wright/perl5/perlbrew/perls/perl-5.20.0/man
PERLBREW_PATH=/Users/c.wright/perl5/perlbrew/bin:/Users/c.wright/perl5/perlbrew/perls/perl-5.20.0/bin
]]>
➔ cpanm -f -v MP3::Info
cpanm (App::cpanminus) 1.7001 on perl 5.020000 built for darwin-2level
Work directory is /Users/c.wright/.cpanm/work/1406801700.10348
You have make /usr/bin/make
You have /usr/bin/curl
You have /usr/bin/tar: bsdtar 2.8.3 - libarchive 2.8.3
You have /usr/bin/unzip
Checking if you have ExtUtils::MakeMaker 6.31 ... Yes (6.98)
Checking if you have ExtUtils::Install 1.46 ... Yes (1.67)
Searching MP3::Info on mirror http://cpanmirror.wtf.nap ...
Downloading index file http://cpanmirror.wtf.nap/modules/02packages.details.txt.gz ...
######################################################################## 100.0%
Uncompressing index file...
--> Working on MP3::Info
######################################################################## 100.0%...
OK
Unpacking MP3-Info-1.24.tar.gz
x MP3-Info-1.24/
x MP3-Info-1.24/inc/
x MP3-Info-1.24/inc/Module/
x MP3-Info-1.24/inc/Module/Install.pm
x MP3-Info-1.24/inc/Module/Install/
x MP3-Info-1.24/inc/Module/Install/AutoInstall.pm
x MP3-Info-1.24/inc/Module/Install/Fetch.pm
x MP3-Info-1.24/inc/Module/Install/Makefile.pm
x MP3-Info-1.24/inc/Module/Install/Include.pm
x MP3-Info-1.24/inc/Module/Install/Base.pm
x MP3-Info-1.24/inc/Module/Install/Metadata.pm
x MP3-Info-1.24/inc/Module/Install/Can.pm
x MP3-Info-1.24/inc/Module/Install/WriteAll.pm
x MP3-Info-1.24/inc/Module/Install/Win32.pm
x MP3-Info-1.24/inc/Module/AutoInstall.pm
x MP3-Info-1.24/Changes
x MP3-Info-1.24/t/
x MP3-Info-1.24/t/test1.mp3
x MP3-Info-1.24/t/id3.t
x MP3-Info-1.24/t/testv1.mp3
x MP3-Info-1.24/t/testv2.2.0.mp3
x MP3-Info-1.24/t/getset.t
x MP3-Info-1.24/t/testv2.3.0.mp3
x MP3-Info-1.24/t/testv1.1.mp3
x MP3-Info-1.24/t/test2.mp3
x MP3-Info-1.24/t/testv2.4.0.mp3
x MP3-Info-1.24/t/test.aiff
x MP3-Info-1.24/t/lame-info.t
x MP3-Info-1.24/t/remove.t
x MP3-Info-1.24/MANIFEST
x MP3-Info-1.24/TODO
x MP3-Info-1.24/eg/
x MP3-Info-1.24/eg/mp3tag.PL
x MP3-Info-1.24/eg/mp3tocddb.PL
x MP3-Info-1.24/Info.pm
x MP3-Info-1.24/README
x MP3-Info-1.24/Makefile.PL
Entering MP3-Info-1.24
META.yml/json not found. Creating skeleton for it.
Running Makefile.PL
Configuring MP3-Info-1.24 ... Checking if your kit is complete...
Looks good
Generating a Unix-style Makefile
Writing Makefile for MP3::Info
Writing MYMETA.yml and MYMETA.json
OK
Checking dependencies from MYMETA.json ...
Checking if you have ExtUtils::MakeMaker 0 ... Yes (6.98)
Building and testing MP3-Info-1.24 ... cp Info.pm blib/lib/MP3/Info.pm
Manifying blib/man3/MP3::Info.3
PERL_DL_NONLAZY=1 /Users/c.wright/perl5/perlbrew/perls/perl-5.20.0/bin/perl "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'inc', 'blib/lib', 'blib/arch')" t/getset.t t/id3.t t/lame-info.t t/remove.t
t/getset.t ..... ok
t/id3.t ........ ok
t/lame-info.t .. ok
t/remove.t ..... ok
All tests successful.
Files=4, Tests=246, 1 wallclock secs ( 0.05 usr 0.01 sys + 0.21 cusr 0.04 csys = 0.31 CPU)
Result: PASS
Appending installation info to /Users/c.wright/perl5/lib/perl5/darwin-2level/perllocal.pod
OK
Successfully reinstalled MP3-Info-1.24
Installing /Users/c.wright/perl5/lib/perl5/darwin-2level/.meta/MP3-Info-1.24/install.json
1 distribution installed
]]>
➔ cpanm -v MP3::Info
cpanm (App::cpanminus) 1.7001 on perl 5.020000 built for darwin-2level
Work directory is /Users/c.wright/.cpanm/work/1406801664.10338
You have make /usr/bin/make
You have /usr/bin/curl
You have /usr/bin/tar: bsdtar 2.8.3 - libarchive 2.8.3
You have /usr/bin/unzip
Checking if you have ExtUtils::MakeMaker 6.31 ... Yes (6.98)
Checking if you have ExtUtils::Install 1.46 ... Yes (1.67)
Searching MP3::Info on mirror http://cpanmirror.wtf.nap ...
Downloading index file http://cpanmirror.wtf.nap/modules/02packages.details.txt.gz ...
######################################################################## 100.0%
Uncompressing index file...
MP3::Info is up to date. (1.24)
]]>
504 \curl -L http://install.perlbrew.pl | bash
505 source ~/perl5/perlbrew/etc/bashrc
506 perlbrew available
507 perlbrew install perl-5.20.0
508 perlbrew switch perl-5.20.0
➔ find /Users/c.wright/perl5/ -name Info.pm
/Users/c.wright/perl5//lib/perl5/MP3/Info.pm
I’ll admit that I haven’t started a full-on investigation, but this is really quite frustrating and confusing:
➔ perlbrew install perl-5.20.0
Fetching perl 5.20.0 as /Users/c.wright/perl5/perlbrew/dists/perl-5.20.0.tar.bz2
Download http://www.cpan.org/src/5.0/perl-5.20.0.tar.bz2 to /Users/c.wright/perl5/perlbrew/dists/perl-5.20.0.tar.bz2
Installing /Users/c.wright/perl5/perlbrew/build/perl-5.20.0 into ~/perl5/perlbrew/perls/perl-5.20.0
This could take a while. You can run the following command on another shell to track the status:
tail -f ~/perl5/perlbrew/build.perl-5.20.0.log
perl-5.20.0 is successfully installed.
➔ perlbrew switch perl-5.20.0
➔ which perl
/Users/c.wright/perl5/perlbrew/perls/perl-5.20.0/bin/perl
➔ perlbrew install-cpanm
cpanm is installed to
/Users/c.wright/perl5/perlbrew/bin/cpanm
➔ cpanm MP3::Info
--> Working on MP3::Info
Fetching http://cpanmirror.wtf.nap/authors/id/D/DA/DANIEL/MP3-Info-1.24.tar.gz ... OK
Configuring MP3-Info-1.24 ... OK
Building and testing MP3-Info-1.24 ... OK
Successfully installed MP3-Info-1.24
1 distribution installed
➔ perl -MMP3::Info -e1
Can't locate MP3/Info.pm in @INC (you may need to install the MP3::Info module) (@INC contains: /Users/c.wright/perl5/perlbrew/perls/perl-5.20.0/lib/site_perl/5.20.0/darwin-2level /Users/c.wright/perl5/perlbrew/perls/perl-5.20.0/lib/site_perl/5.20.0 /Users/c.wright/perl5/perlbrew/perls/perl-5.20.0/lib/5.20.0/darwin-2level /Users/c.wright/perl5/perlbrew/perls/perl-5.20.0/lib/5.20.0 .).
BEGIN failed--compilation aborted.
➔ /Users/c.wright/perl5/perlbrew/bin/cpanm MP3::Info
MP3::Info is up to date. (1.24)
sigh
]]>Install irssi
sudo apt-get install irssi
Grab the script:
mkdir -p $HOME/development
cd $HOME/development
git clone https://github.com/chiselwright/irc-notifications.git
cd irc-notifications
Make sure you have required perl modules available
perl Makefile.PL
Install any missing modules. (TODO: make irssi scripts work with perlbrew)
Install the script:
sh SETUP.sh
You should see something like:
➔ sh SETUP.sh
mkdir: created directory `/home/chisel/.irssi'
mkdir: created directory `/home/chisel/.irssi/scripts'
mkdir: created directory `/home/chisel/.irssi/scripts/autorun'
If you now run
irssi
you should see something like this (assuming you have an out of the box installation, with no configuration of your own yet):
19:03 -!- Irssi: irc_appnotify 0.08 ready
Any errors means some investigation into what didn’t quite work in the setup.
At this point you’ve got irssi installed and the notification plugin ready to go. Almost.
Download the relevant app for your device from https://pushover.net/clients. [NOT FREE].
SIgn up at https://pushover.net/. Copy your user key from your dashboard.
/set notify_pushover_user_key YOUR_USER_KEY
/set notify_methods Pushover
/save
Store network info for future ease:
/NETWORK ADD perlOrg
/SERVER ADD -auto -network perlOrg irc.perl.org 6667
/save
Connect, set a nickname:
/connect perlOrg
/nick myTestNick
Send yourself a test message:
/q myTestNick Hello
Check your device for a PushOver alert.
I’m assuming you’re already the proud owner of a Pebble watch.
Open the Pushover preferences, tick “Display notifications on Pebble”. Sorted!
/q myTestNick Welcome to the future!
… and look at your watch.
]]>Perl 5.8.9 documentation, Dec 2008.
(http://perldoc.perl.org/5.8.9/functions/each.html)
As I understand it, getting hash data back in a predictable order is a bug that people have learned to rely on - but still a bug.
Hash-based tests really ought to be using "cmp_deeply($foo, bag(...))" or "sort keys %hash" idioms.
This change revealed bugs in test-suites; yes many of us fell into the same trap, but I'd argue that is *is* the module author's responsibility to fix the bug in their code that's been masked by the bug in perl's hash ordering.
Further reading:
- http://perldoc.perl.org/perlsec.html#Algorithmic-Complexity-Attacks
- http://lwn.net/Articles/474912/
I'm not using the "stock" dist.ini (link near the start) so I have extra features to prepare for.
If you reread the actual work needed, and skip over the explanation around it, you should hopefully see that there isn't really all that much going on:
- clean-up files dzil will manage for us
- make git ignore a few files
- deal with missing metadata
- test for silly omissions
You can reduce the amount of work you need to do to use dzil by using a cut down list of plugins but for me this is a good set that gives me some useful things, automatically, every release. More importantly, I get these things done for me and I'm producing high quality distro fastballs without the post release cycle of "oops, forgot to update Changes", "oops forgot to manually update the version number in one package", and other corrections I used to make but can no longer remember.
By all means just run "dzil new My::Module" with a stock profile, and you've got something you can use and release with - but this isn't leveraging the true power of Dist::Zilla in my opinion.
]]>Worst case, future-me will thank present-me (or will that be past-me?)
What follows is the transition for WebService::NotifyMyAndroid. It might have a couple of places where common sense needs to be applied, but it’s ‘good enough’.
I’m assuming you’ve already got a perl distribution and that you’re managing it with git.
I’m also asssuming you already have Dist::Zilla installed.
My distributions are minted using this file as a template for dist.ini.
Just to be safe we’ll work from anew branch based on our current master:
git checkout master
git pull --rebase
git co -b dzil master
Now we’re ready to rock and roll!
I’m ‘lazy’ and don’t like to write mine by hand, so I’ll let Dist::Zilla do the work for me:
dzil new WebService::NotifyMyAndroid
mv WebService-NotifyMyAndroid/dist.ini .
rm -rf WebService-NotifyMyAndroid/
git add dist.ini
If you don’t already have it, it’s worth adding
[AutoPrereqs]
to your dist.ini.
To make ‘CheckChangesHasContent’ happy add the following before the most recent release:
{{$NEXT}}
Convert to Dist::Zilla
then add it to the staged area:
git add Changes
Get rid of the files that we used to manage ourselves manually:
dzil build --notgz 2>&1 |grep 'multiple times' |cut -d' ' -f 5
If you don’t get any output at all it’s worth re-running without the piped-cut to make sure it didn’t abort the build earlier than expected.
The output should look something like this:
MANIFEST
META.yml
README
Makefile.PL
Checking the files, all the files, bar README, are autogenerated. Looking at the README we decide we’d like to keep this file, but under a different name:
git mv README README.install
Then remove the other files:
for f in $( \
dzil build --notgz 2>&1 \
|grep 'multiple times' \
|cut -d' ' -f 5 \
); do
# make sure we don't git manage them
git rm -f $f;
# make sure they aren't artifacts form previous builds
rm -f $f;
done;
We also no longer need these files:
rm -rf blib/ _build/
git rm Build.PL
rm -rf blib/ _build/ Build
Nor do we want any META files hanging around:
for f in MANIFEST* *META*; do
git rm -f $f 2>/dev/null; \
rm -f $f; \
done
Dist::Zilla generates build directories and files based on our dist name; let’s ignore them:
echo '/WebService-NotifyMyAndroid*tar.gz' >> .gitignore
echo '/WebService-NotifyMyAndroid*/' >> .gitignore
echo '/.build/' >> .gitignore
git add .gitignore
Anywhere we’ve manually specified $VERSION we should simple remove it:
# remove manual version setting in thse files
vim $(/bin/grep -rl 'our $VERSION' lib/)
# git status
# git add <files we edited>
To list files with missing abstracts simple do he following:
dzil build --notgz |grep "couldn't find abstract" |cut -d' ' -f 7
You should edit these manually and add an appropriate:
# ABSTRACT: <one line abstract>
line to each of the files. I prefer to put my comment at the end of the file (but before the END marker:
1;# Magic true value required at end of module
# ABSTRACT: Perl interface to Notify My Android web API
__END__
Don’t forget to ‘git add’ any files you’ve edited.
Assuming you also use the PodWeaver plugin, you should work through all the perl and POD files in your distribution to make the following alterations:
No need to add the NAME section:
=head1 NAME
WebService::NotifyMyAndroid - Perl interface to Notify My Android web API
No need to manually specify and update the VERSION block:
=head1 VERSION
This document describes WebService::NotifyMyAndroid version 0.0.3.
This is added automatically, so you can remove any of these sections
In lieu of a ‘Contributor plugin’ you may wish to promote your contributors to authors - otherwise you end up with them in different parts of the woven POD.
Make sure you specify your authors in dist.ini:
author = Steve Huff <shuff@cpan.org>
author = Chisel <chisel@chizography.net>
and remove any ‘AUTHOR’ and ‘CONTRIBUTOR’ sections in your POD.
I did this just for this distro, just to cleanup:
git rm README.mkd
We’re in the final stages now; time to push our work to our remote to keep it safe:
git commit -m 'Convert dist to use Dist::Zilla'
git push -u origin master
From my experience, you’ll always miss something obvious, or silly when converting to Dist::Zilla, so it’s probably best to release a developer release of the module until there’s enough feedback from CPAN Testers for us to fix everything, or decide it’s good enought to release to the world:
dzil clean && \
V=0.0.5_01 dzil release
If you’re anything like me, you’ll miss a few things on your first release, no matter how careful you are. You’ll also probably find you get failures for unexpected and surprising reasons.
Don’t despair, just chip away at the niggles until you have a developer release that shows as a pass for all (or near enough) reports on CPAN Testers.
]]> $WebService::NotifyMyAndroid::VERSION = '0.0.6';
I've accidentally turned the module into odd-developement/even-stable versioning, but I'm not sure that how I'd like to stay.
Now that I've crowbarred the understanding into my head I think I'll go from v0.0.6 to v0.0.6_01
Looking at it now it's an obvious progression for me.
]]>I realise that it's extra work for people to choose to install a developer release, but I didn't want to make life even more difficult for them when the release was finalised.
I like the idea of having dev releases with individual entries in the Changes ... and then merging them into one combined list when the non-dev release is made.
Sadly I realised the versioning mistake, and read your suggestion far too late for the module that had to live through this thought process.
Next time ...
]]>