in reply to Re: buildpacked.pl - Pack script and dependencies into self-extracting bash script
in thread buildpacked.pl - Pack script and dependencies into self-extracting bash script
So here is my version :)
#!/usr/bin/perl -- use strict; use warnings; use Data::Dump; use Module::Corelist; @ARGV or die "Usage: $0 outfile infile infile infile\n"; my $outfile = shift || 'ddname'; my @script = @ARGV ? @ARGV : qw[ dd-inc.pl ]; my @cache = qw[ -C CACHEFILE ]; my %exclude; # we don't pack core modules available in this perl my %include; for ( qx[scandeps @cache -B -V @script ] ){ /^'([^']+)'/ or next; my $mod = $1; my $first = Module::CoreList->first_release($mod); my $removed = Module::CoreList->removed_from($mod); $exclude{$mod}++ if defined $first and $first < $] ; # core in + this perl $include{$mod}++ if defined $removed and $] >= $removed; # removed + (not core) in this perl } my @exclude = map {; '-X', $_ } keys %exclude; my @include = map {; '-M', $_ } keys %include; #~ my @args = ( qw[ pp --perlscript --output ] => $outfile, @exclude, +@include, @script ); my @args = ( qw[ pp -P -o ] => $outfile, @exclude, @include, @script ) +; dd \@args; system @args; __END__
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: buildpacked.pl - Pack script and dependencies into self-extracting bash script
by jbryan (Acolyte) on Aug 21, 2012 at 20:21 UTC | |
by Anonymous Monk on Aug 21, 2012 at 20:26 UTC | |
by jbryan (Acolyte) on Aug 21, 2012 at 20:29 UTC | |
by Anonymous Monk on Aug 22, 2012 at 09:38 UTC |