ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/App-Staticperl/mkbundle
(Generate patch)

Comparing App-Staticperl/mkbundle (file contents):
Revision 1.13 by root, Sun Dec 12 00:23:17 2010 UTC vs.
Revision 1.14 by root, Wed Dec 22 01:23:37 2010 UTC

230 my $path = "$_[0]/$_"; 230 my $path = "$_[0]/$_";
231 231
232 if (-d "$path/.") { 232 if (-d "$path/.") {
233 $scan->($path); 233 $scan->($path);
234 } else { 234 } else {
235 next unless /\.(?:pm|pl)$/;
236
237 $path = substr $path, $skip; 235 $path = substr $path, $skip;
238 push @tree, $path 236 push @tree, $path
239 unless exists $INCSKIP{$path}; 237 unless exists $INCSKIP{$path};
240 } 238 }
241 } 239 }
294 292
295 for (get_inctrees) { 293 for (get_inctrees) {
296 my ($dir, $files) = @$_; 294 my ($dir, $files) = @$_;
297 295
298 $pm{$_} = "$dir/$_" 296 $pm{$_} = "$dir/$_"
299 for grep /$pattern/, @$files; 297 for grep /$pattern/ && /\.(pl|pm)$/, @$files;
300 } 298 }
301} 299}
302 300
303sub parse_argv; 301sub parse_argv;
304 302
325 323
326use Getopt::Long; 324use Getopt::Long;
327 325
328sub parse_argv { 326sub parse_argv {
329 GetOptions 327 GetOptions
330 "strip=s" => \$STRIP, 328 "strip=s" => \$STRIP,
331 "cache=s" => \$CACHE, # internal option 329 "cache=s" => \$CACHE, # internal option
332 "verbose|v" => sub { ++$VERBOSE }, 330 "verbose|v" => sub { ++$VERBOSE },
333 "quiet|q" => sub { --$VERBOSE }, 331 "quiet|q" => sub { --$VERBOSE },
334 "perl" => \$PERL, 332 "perl" => \$PERL,
335 "app=s" => \$APP, 333 "app=s" => \$APP,
336 "eval|e=s" => sub { trace_eval $_[1] }, 334 "eval|e=s" => sub { trace_eval $_[1] },
337 "use|M=s" => sub { trace_module $_[1] }, 335 "use|M=s" => sub { trace_module $_[1] },
338 "boot=s" => sub { cmd_boot $_[1] }, 336 "boot=s" => sub { cmd_boot $_[1] },
339 "add=s" => sub { cmd_add $_[1], 0 }, 337 "add=s" => sub { cmd_add $_[1], 0 },
340 "addbin=s" => sub { cmd_add $_[1], 1 }, 338 "addbin=s" => sub { cmd_add $_[1], 1 },
341 "incglob=s" => sub { cmd_incglob $_[1] }, 339 "incglob=s" => sub { cmd_incglob $_[1] },
342 "include|i=s" => sub { cmd_include $_[1], 1 }, 340 "include|i=s" => sub { cmd_include $_[1], 1 },
343 "exclude|x=s" => sub { cmd_include $_[1], 0 }, 341 "exclude|x=s" => sub { cmd_include $_[1], 0 },
344 "static!" => \$STATIC, 342 "static!" => \$STATIC,
345 "usepacklist!" => \$PACKLIST, 343 "usepacklists!" => \$PACKLIST,
346 "staticlib=s" => sub { cmd_staticlib $_[1] }, 344 "staticlib=s" => sub { cmd_staticlib $_[1] },
347 "<>" => sub { cmd_file $_[0] }, 345 "<>" => sub { cmd_file $_[0] },
348 or exit 1; 346 or exit 1;
349} 347}
350 348
351Getopt::Long::Configure ("bundling", "no_auto_abbrev", "no_ignore_case"); 349Getopt::Long::Configure ("bundling", "no_auto_abbrev", "no_ignore_case");
352 350
357 355
358# required for @INC loading, unfortunately 356# required for @INC loading, unfortunately
359trace_module "PerlIO::scalar"; 357trace_module "PerlIO::scalar";
360 358
361############################################################################# 359#############################################################################
362# include/exclude apply 360# apply include/exclude
363 361
364{ 362{
365 my %pmi; 363 my %pmi;
366 364
367 for (@incext) { 365 for (@incext) {
377 if $VERBOSE >= 5; 375 if $VERBOSE >= 5;
378 } else { 376 } else {
379 # exclude 377 # exclude
380 delete @pm{@match}; 378 delete @pm{@match};
381 379
382 print "applying exclude $glob - excluded ", (scalar @match), " files.\n" 380 print "applying exclude $glob - removed ", (scalar @match), " files.\n"
383 if $VERBOSE >= 5; 381 if $VERBOSE >= 5;
384 } 382 }
385 } 383 }
386 384
387 my @pmi = keys %pmi; 385 my @pmi = keys %pmi;
388 @pm{@pmi} = delete @pmi{@pmi}; 386 @pm{@pmi} = delete @pmi{@pmi};
389} 387}
390 388
391############################################################################# 389#############################################################################
392# scan for AutoLoader and static archives 390# scan for AutoLoader, static archives and other dependencies
393 391
394sub scan_al { 392sub scan_al {
395 my ($auto, $autodir) = @_; 393 my ($auto, $autodir) = @_;
396 394
397 my $ix = "$autodir/autosplit.ix"; 395 my $ix = "$autodir/autosplit.ix";
467 print "found .packlist for $pm\n" 465 print "found .packlist for $pm\n"
468 if $VERBOSE >= 3; 466 if $VERBOSE >= 3;
469 467
470 while (<$fh>) { 468 while (<$fh>) {
471 chomp; 469 chomp;
470 s/ .*$//; # newer-style .packlists might contain key=value pairs
472 471
473 # only include certain files (.al, .ix, .pm, .pl) 472 # only include certain files (.al, .ix, .pm, .pl)
474 if (/\.(pm|pl|al|ix)$/) { 473 if (/\.(pm|pl|al|ix)$/) {
475 for my $inc (@INC) { 474 for my $inc (@INC) {
476 # in addition, we only add files that are below some @INC path 475 # in addition, we only add files that are below some @INC path

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines