Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to create META.json using Module::Build and how to link to the VCS?

2 views
Skip to first unread message

Gabor Szabo

unread,
Jan 3, 2013, 6:04:33 AM1/3/13
to List - Module-Build
Hi,

recently I wrote an article how people could include a link to their
version control system in the META.yml file.
http://perl5maven.com/how-to-add-link-to-version-control-system-of-a-cpan-distributions

After getting a few comments I found out that beside the link to the
repository one could also include the type of
the repository (git/svn/etc...), but as far as I can see only
META.json holds that information.
At least in the distributions I checked only META.json had this.
All these distributions were generated using Dist::Zilla.

So I wonder how can ask Module::Build to generate META.json as well,
and how can I tell it
to include the other fields of the repository as well?

regards
Gabor

Leon Timmermans

unread,
Jan 3, 2013, 8:18:34 AM1/3/13
to Gabor Szabo, List - Module-Build
On Thu, Jan 3, 2013 at 12:04 PM, Gabor Szabo <ga...@szabgab.com> wrote:
> After getting a few comments I found out that beside the link to the
> repository one could also include the type of
> the repository (git/svn/etc...), but as far as I can see only
> META.json holds that information.
> At least in the distributions I checked only META.json had this.
> All these distributions were generated using Dist::Zilla.
>
> So I wonder how can ask Module::Build to generate META.json as well,
> and how can I tell it
> to include the other fields of the repository as well?

Since version 0.3800 Module::Build generates valid META.json, but it's
actually upconverted meta 1.4, so it won't contain any of the new
fields. This is a known bug. I would welcome someone adding proper
meta 2.0 support, but it's fairly low on my own todo list to be
honest. MakeMaker has the same issue.

Leon

Gabor Szabo

unread,
Jan 3, 2013, 10:44:35 AM1/3/13
to Leon Timmermans, List - Module-Build
Thanks.

I checked on a distribution that is using MB and it created the
META.json for me too. ++!

Interestingly Sam Graham posted a link to his article where he shows
how he did this
2 years ago:
http://www.illusori.co.uk/blog/2013/01/03/setting-repository-with-module-build.html

I tried the same using MB 0.4003 but got the following error:

Error is: Invalid metadata structure. Errors: 'HASH(0xfcde50)' for
'repository' does not have a URL scheme (resources -> repository)
[Validation: 1.4]

Was the feature removed?

regards
Gabor

Gabor Szabo

unread,
Jan 3, 2013, 11:38:38 AM1/3/13
to John M. Gamble, List - Module-Build
John,

just a misunderstanding.

repository => 'git://github.com/jgamble/Math-Polynomial-Solve.git',

works

repository => {
url => 'git://github.com/jgamble/Math-Polynomial-Solve.git',
web => 'http://github.com/jgamble/Math-Polynomial-Solve',
type => 'git',
}

does NOT. (but it would be nice if it did)

Just as Leon wrote.

Gabor

Leon Timmermans

unread,
Jan 3, 2013, 6:29:47 PM1/3/13
to Gabor Szabo, John M. Gamble, List - Module-Build
What we really need is a meta_merge2 key. Or maybe a repository key.
Or probably both would be nice to have.

Leon
0 new messages