From: Matt S Trout Date: Mon, 14 Nov 2011 22:49:14 +0000 (+0000) Subject: generate a lib/Tak/STDIONode.pm containing relevant fatpacked stuff X-Git-Tag: v0.001001~5 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=3f28f492d82ced72c8d41027e2ab19ee008004e8;p=scpubgit%2FTak.git generate a lib/Tak/STDIONode.pm containing relevant fatpacked stuff --- diff --git a/Makefile.PL b/Makefile.PL index 58478e2..f050a99 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -20,5 +20,5 @@ WriteMakefile( 'Config::Settings' => '0.02', }, LICENSE => 'perl', - EXE_FILES => [ 'bin/tak' ], + EXE_FILES => [ 'bin/tak', 'bin/tak/stdio-node' ], ); diff --git a/bin/tak-stdio-node b/bin/tak-stdio-node new file mode 100755 index 0000000..2440890 --- /dev/null +++ b/bin/tak-stdio-node @@ -0,0 +1,4 @@ +#!/usr/bin/env perl + +use Tak::STDIOSetup; +Tak::STDIOSetup->run; diff --git a/lib/Tak/ConnectorService.pm b/lib/Tak/ConnectorService.pm index 7e1d4b1..b9f59d1 100644 --- a/lib/Tak/ConnectorService.pm +++ b/lib/Tak/ConnectorService.pm @@ -6,6 +6,7 @@ use Tak::Router; use Tak::Client; use Tak::ConnectionService; use Net::OpenSSH; +use Tak::STDIONode; use Moo; with 'Tak::Role::Service'; @@ -18,7 +19,7 @@ sub handle_create { my ($self, $on, %args) = @_; my $log_level = $args{log_level}||'info'; my ($kid_in, $kid_out, $kid_pid) = $self->_open($on, $log_level); - $kid_in->print(io('maint/mk-fat |')->all, "__END__\n"); + $kid_in->print($Tak::STDIONode::DATA, "__END__\n"); # Need to get a handshake to indicate STDIOSetup has finished # messing around with file descriptors, otherwise we can severely # confuse things by sending before the dup. diff --git a/maint/mk-fat b/maint/mk-fat index 4b6799e..c1a22d0 100755 --- a/maint/mk-fat +++ b/maint/mk-fat @@ -1,7 +1,15 @@ #!/bin/sh -#if [ -e fatlib ]; then rm -r fatlib; fi -#fatpack tree $(fatpack packlists-for strictures.pm Moo.pm JSON/PP.pm MRO/Compat.pm Class/C3.pm Algorithm/C3.pm Log/Contextual.pm Data/Dumper/Concise.pm) -fatpack file -#rm -r fatlib -echo "use lib 'lib'; use Tak::STDIOSetup; Tak::STDIOSetup->run;" +if [ -e fatlib ]; then rm -r fatlib; fi +fatpack tree $(fatpack packlists-for strictures.pm Moo.pm JSON/PP.pm MRO/Compat.pm Class/C3.pm Algorithm/C3.pm Log/Contextual.pm Data/Dumper/Concise.pm) +rm lib/Tak/STDIONode.pm +( + echo 'package Tak::STDIONode; +our $DATA = do { local $/; }; +1; +__DATA__ +'; + fatpack file; + cat bin/tak-stdio-node +)>lib/Tak/STDIONode.pm +rm -r fatlib