generate a lib/Tak/STDIONode.pm containing relevant fatpacked stuff
Matt S Trout [Mon, 14 Nov 2011 22:49:14 +0000 (22:49 +0000)]
Makefile.PL
bin/tak-stdio-node [new file with mode: 0755]
lib/Tak/ConnectorService.pm
maint/mk-fat

index 58478e2..f050a99 100644 (file)
@@ -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 (executable)
index 0000000..2440890
--- /dev/null
@@ -0,0 +1,4 @@
+#!/usr/bin/env perl
+
+use Tak::STDIOSetup;
+Tak::STDIOSetup->run;
index 7e1d4b1..b9f59d1 100644 (file)
@@ -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.
index 4b6799e..c1a22d0 100755 (executable)
@@ -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 $/; <DATA> };
+1;
+__DATA__
+';
+  fatpack file;
+  cat bin/tak-stdio-node
+)>lib/Tak/STDIONode.pm
+rm -r fatlib