Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Install link to allow `pgxn validate-meta` to work.

  • Loading branch information...
commit 9e37f6c705d03e8e3706c139a9cd6c26db378237 1 parent a5a41e2
@theory theory authored
Showing with 34 additions and 3 deletions.
  1. +22 −1 Build.PL
  2. +3 −0  Changes
  3. +9 −2 bin/validate_pgxn_meta
View
23 Build.PL
@@ -2,7 +2,28 @@ use strict;
use warnings;
use Module::Build;
-Module::Build->new(
+my $class = Module::Build->subclass(
+ class => 'My::Builder',
+ code => q{
+ sub ACTION_install {
+ my $self = shift;
+ my $ret = $self->SUPER::ACTION_install(@_);
+ my $pgxn = $self->find_command('pgxn') or return $ret;
+ my $libexec = $self->_backticks($pgxn, 'help', '--libexec');
+ chomp $libexec;
+ if (-d $libexec) {
+ my $dst = File::Spec->catfile($libexec, 'pgxn-validate-meta');
+ $self->log_info("Creating $dst");
+ unlink $dst;
+ link File::Spec->catfile(
+ $self->install_map->{'blib/script'}, 'validate_pgxn_meta'
+ ), $dst;
+ }
+ }
+ },
+);
+
+$class->new(
module_name => 'PGXN::Meta::Validator',
license => 'perl',
create_makefile_pl => 'traditional',
View
3  Changes
@@ -4,6 +4,9 @@ Revision history for Perl extension PGXN-Meta-Validator.
- Added tests to protect against autovivication of keys.
- Rewrote all error messages to be more consistent and informative.
- Removed unused `header()` method.
+ - Added support for running under
+ [pgxn](http://pgxnclient.projects.postgresql.org/) as `pgxn
+ validate-meta META.json`.
0.13.0 2011-05-26T03:52:07
- Fixed invalid Unicode character class.
View
11 bin/validate_pgxn_meta
@@ -1,4 +1,4 @@
-#!/usr/bin/perl -w
+#!/usr/local/bin/perl -w
use strict;
use warnings;
@@ -38,11 +38,18 @@ print "$file is invalid. Errors:\n ",
"\n";
exit 1;
+
sub _pod2usage {
require Pod::Usage;
+
+ my $sections = 'Usage|Options';
+ if ($0 =~ /pgxn-validate-meta/) {
+ print "Usage:\n pgxn validate-meta META.json\n\n";
+ $sections = 'Options';
+ }
Pod::Usage::pod2usage(
'-verbose' => 99,
- '-sections' => '(?i:(Usage|Options))',
+ '-sections' => "(?i:($sections))",
'-exitval' => 1,
'-input' => __FILE__,
@_
Please sign in to comment.
Something went wrong with that request. Please try again.