From: Peter Rabbitson Date: Fri, 17 Jan 2014 01:57:46 +0000 (+0100) Subject: Reuse the TempExtlib trick from DBIC X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=dbsrgits%2FSQL-Abstract.git;a=commitdiff_plain;h=39999edd584b11bf29fa934784af955f4439458c Reuse the TempExtlib trick from DBIC --- diff --git a/.gitignore b/.gitignore index 2c25792..f1481cd 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,5 @@ _build/ blib/ inc/ pm_to_blib + +lib/SQL/Abstract/_TempExtlib/ diff --git a/Makefile.PL b/Makefile.PL index 3b1ad3b..be4ee44 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -4,6 +4,40 @@ use warnings; use 5.006002; +## +## TEMPORARY (and non-portable) +## Get the dq stuff +## +my $target_libdir; +BEGIN { + $target_libdir = 'lib/SQL/Abstract/_TempExtlib'; + + if ($Module::Install::AUTHOR or $ENV{TRAVIS}) { + + `rm -rf $target_libdir`; + `mkdir $target_libdir`; + for ( + [ 'Data-Query' => 'master' ], + ) { + my $tdir = "/tmp/dqlib/$_->[0]/"; + + `rm -rf $tdir`; + + `GIT_SSH=maint/careless_ssh.bash git clone --bare --quiet --branch=$_->[1] --depth=1 git://git.shadowcat.co.uk/dbsrgits/$_->[0] $tdir`; + printf "\nIncluding %s git rev %s\n", + $_->[0], + scalar `GIT_DIR=$tdir git rev-parse $_->[1]`, + ; + `git archive --format=tar --remote=file://$tdir $_->[1] lib/ | tar --strip-components=1 -xC $target_libdir`; + + #`rm -rf $tdir`; + } + } +} + +use lib $target_libdir; + + perl_version '5.006002'; name 'SQL-Abstract'; author 'Nathan Wiger '; @@ -15,6 +49,10 @@ all_from 'lib/SQL/Abstract.pm'; dynamic_config 0; +# deps for Data::Query +requires 'SQL::ReservedWords' => '0.8', +requires 'Safe::Isa' => '1.000003', + requires 'List::Util' => 0; requires 'Scalar::Util' => 0; requires 'Getopt::Long::Descriptive' => 0.091; @@ -30,6 +68,8 @@ test_requires "Storable" => 0; # for cloning in tests no_index package => 'DBIx::Class::Storage::Debug::PrettyPrint'; no_index directory => 'examples'; +no_index package => 'SQL::Abstract::_TempExtlib'; +no_index directory => 'lib/SQL/Abstract/_TempExtlib'; install_script 'format-sql'; diff --git a/lib/SQL/Abstract.pm b/lib/SQL/Abstract.pm index 8f1fe83..fd9cb55 100644 --- a/lib/SQL/Abstract.pm +++ b/lib/SQL/Abstract.pm @@ -1,5 +1,7 @@ package SQL::Abstract; # see doc at end of file +use SQL::Abstract::_TempExtlib; + use Carp (); use List::Util (); use Scalar::Util (); diff --git a/lib/SQL/Abstract/Test.pm b/lib/SQL/Abstract/Test.pm index 419d516..e78fa80 100644 --- a/lib/SQL/Abstract/Test.pm +++ b/lib/SQL/Abstract/Test.pm @@ -1,5 +1,7 @@ package SQL::Abstract::Test; # see doc at end of file +use SQL::Abstract::_TempExtlib; + use strict; use warnings; use base qw(Test::Builder::Module Exporter); diff --git a/lib/SQL/Abstract/Tree.pm b/lib/SQL/Abstract/Tree.pm index c14ec11..1decca5 100644 --- a/lib/SQL/Abstract/Tree.pm +++ b/lib/SQL/Abstract/Tree.pm @@ -1,5 +1,7 @@ package SQL::Abstract::Tree; +use SQL::Abstract::_TempExtlib; + use Carp; use Hash::Merge (); diff --git a/lib/SQL/Abstract/_TempExtlib.pm b/lib/SQL/Abstract/_TempExtlib.pm new file mode 100644 index 0000000..fe111cf --- /dev/null +++ b/lib/SQL/Abstract/_TempExtlib.pm @@ -0,0 +1,14 @@ +package # hide from the pauses + SQL::Abstract::_TempExtlib; + +use strict; +use warnings; +use File::Spec; + +our ($HERE) = File::Spec->rel2abs( + File::Spec->catdir( (File::Spec->splitpath(__FILE__))[1], '_TempExtlib' ) +) =~ /^(.*)$/; # screw you, taint mode + +unshift @INC, $HERE; + +1; diff --git a/maint/careless_ssh.bash b/maint/careless_ssh.bash new file mode 100755 index 0000000..1b9e0bc --- /dev/null +++ b/maint/careless_ssh.bash @@ -0,0 +1,3 @@ +#!/bin/bash + +/usr/bin/ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no "$@"