--- cvsroot/App-Staticperl/mkbundle 2010/12/10 20:29:17 1.12 +++ cvsroot/App-Staticperl/mkbundle 2011/01/10 14:12:03 1.15 @@ -232,8 +232,6 @@ if (-d "$path/.") { $scan->($path); } else { - next unless /\.(?:pm|pl)$/; - $path = substr $path, $skip; push @tree, $path unless exists $INCSKIP{$path}; @@ -296,7 +294,7 @@ my ($dir, $files) = @$_; $pm{$_} = "$dir/$_" - for grep /$pattern/, @$files; + for grep /$pattern/ && /\.(pl|pm)$/, @$files; } } @@ -327,24 +325,24 @@ sub parse_argv { GetOptions - "strip=s" => \$STRIP, - "cache=s" => \$CACHE, # internal option - "verbose|v" => sub { ++$VERBOSE }, - "quiet|q" => sub { --$VERBOSE }, - "perl" => \$PERL, - "app=s" => \$APP, - "eval|e=s" => sub { trace_eval $_[1] }, - "use|M=s" => sub { trace_module $_[1] }, - "boot=s" => sub { cmd_boot $_[1] }, - "add=s" => sub { cmd_add $_[1], 0 }, - "addbin=s" => sub { cmd_add $_[1], 1 }, - "incglob=s" => sub { cmd_incglob $_[1] }, - "include|i=s" => sub { cmd_include $_[1], 1 }, - "exclude|x=s" => sub { cmd_include $_[1], 0 }, - "static!" => \$STATIC, - "usepacklist!" => \$PACKLIST, - "staticlib=s" => sub { cmd_staticlib $_[1] }, - "<>" => sub { cmd_file $_[0] }, + "strip=s" => \$STRIP, + "cache=s" => \$CACHE, # internal option + "verbose|v" => sub { ++$VERBOSE }, + "quiet|q" => sub { --$VERBOSE }, + "perl" => \$PERL, + "app=s" => \$APP, + "eval|e=s" => sub { trace_eval $_[1] }, + "use|M=s" => sub { trace_module $_[1] }, + "boot=s" => sub { cmd_boot $_[1] }, + "add=s" => sub { cmd_add $_[1], 0 }, + "addbin=s" => sub { cmd_add $_[1], 1 }, + "incglob=s" => sub { cmd_incglob $_[1] }, + "include|i=s" => sub { cmd_include $_[1], 1 }, + "exclude|x=s" => sub { cmd_include $_[1], 0 }, + "static!" => \$STATIC, + "usepacklists!" => \$PACKLIST, + "staticlib=s" => sub { cmd_staticlib $_[1] }, + "<>" => sub { cmd_file $_[0] }, or exit 1; } @@ -359,7 +357,7 @@ trace_module "PerlIO::scalar"; ############################################################################# -# include/exclude apply +# apply include/exclude { my %pmi; @@ -379,7 +377,7 @@ # exclude delete @pm{@match}; - print "applying exclude $glob - excluded ", (scalar @match), " files.\n" + print "applying exclude $glob - removed ", (scalar @match), " files.\n" if $VERBOSE >= 5; } } @@ -389,7 +387,7 @@ } ############################################################################# -# scan for AutoLoader and static archives +# scan for AutoLoader, static archives and other dependencies sub scan_al { my ($auto, $autodir) = @_; @@ -469,6 +467,7 @@ while (<$fh>) { chomp; + s/ .*$//; # newer-style .packlists might contain key=value pairs # only include certain files (.al, .ix, .pm, .pl) if (/\.(pm|pl|al|ix)$/) { @@ -531,7 +530,7 @@ unless ($pmbin{$pm}) { # only do this unless the file is binary if ($pm =~ /^auto\/POSIX\/[^\/]+\.al$/) { if ($src =~ /^ unimpl \"/m) { - print "$pm: skipping (only raises runtime error).\n" + print "$pm: skipping (raises runtime error only).\n" if $VERBOSE >= 3; next; } @@ -664,7 +663,7 @@ } else { warn "WARNING: $pm{$pm}: PPI failed to parse this file\n"; } - } elsif ($STRIP =~ /pod/i && $pm ne "Opcode.pm") { # opcode parses it's own pod + } elsif ($STRIP =~ /pod/i && $pm ne "Opcode.pm") { # opcode parses its own pod require Pod::Strip; my $stripper = Pod::Strip->new;