makepp

 view release on metacpan or  search on metacpan

Mpp/BuildCacheControl.pm  view on Meta::CPAN


=head2 ARGVgroups { code }

This calls C<group> for each element in C<@ARGV>, and calls I<code> for each
group that wasn't already identified by an earlier element.

=cut

our $blend;
my $blendopt = ['b', qr/blend(?:[-_]?groups?)?/, \$blend];
sub ARGVgroups(&) {
  unless( @ARGV ) {
    -f $Mpp::BuildCache::options_file
      or die "$0: no build cache directories given and not in one\n";
    @ARGV = '.';
  }
  if( $blend ) {
    group @ARGV;
    &{$_[0]};
  } else {
    my %seen;

Mpp/BuildCacheControl.pm  view on Meta::CPAN


=head3 @combined_lstat

This is the virtual lstat for the file, where the times are the maximum of all
replicates' times.  EXTLINK is the sum of all replicates' EXTLINK.

=cut

our( @lstats, @combined_lstat );
our $clean_empty;
sub groupfind(&;$) {
  my( $code, $try ) = @_;
  my $top = 1 unless defined $try;
  my( @dirs, @contents );
  @dirs = map $top ? $_->{DIRNAME} : "$_->{DIRNAME}/$try", @group;
  for( @dirs ) {
    if( opendir my( $dh ), $_ ) {
      my %contents;
      @contents{(readdir $dh)} = (); # Parens needed for list context to readdir.
      delete @contents{qw(. ..), $Mpp::File::build_info_subdir};
      delete @contents{$Mpp::BuildCache::options_file, $Mpp::BuildCache::incoming_subdir}

Mpp/Cmds.pm  view on Meta::CPAN

}

sub eval_or_die($) {
  $Mpp::Rule::unsafe = 1;
  Mpp::Subs::eval_or_die $_[0], $Mpp::Subs::rule->{MAKEFILE}, $Mpp::Subs::rule->{RULE_SOURCE};
}


# perform one step and log or die as appropriate
our( $install_date, $install_log );
sub perform(&$;$) {
  if( eval { &{$_[0]} } && !$@ ) {
    print STDERR "$0: $_[1]\n" if $Mpp::verbose;
    if( $install_log ) {
      my $msg = $_[1];
      my $cwd = absolute_filename $CWD_INFO;
      $msg =~ s|`(?=[^/`][^`]*$)|`$cwd/|;
      if( $Mpp::Event::max_proc > 1 ) {
	flock $install_log, 2;	# Lock exclusive.
	if( $install_date =~ /^ / ) { # Additional output
	  if( (stat $install_log)[7] > tell $install_log ) {

Mpp/Cmds.pm  view on Meta::CPAN

    if( 8 * 1024 < length $print ) {
      # Mixing this with a final print is ok, as buffering comes last.  syswrite is faster only from 3kb upwards.
      syswrite select, $print or die $!;
      $print = '';
    }
  }
}


# Frame which handles options, I/O and adds omnipresent --verbose.
sub frame(&@) {
  my( $code, @opts, @stdopts ) = @_;
  local $Mpp::verbose = $Mpp::verbose;

  my( $infail, $inout, $output, $pipe, $select, $outfail, $separator );
  # Standard options shared by several commands.
  my %opt =
    (E => ['E', qr/no[-_]?escape/, \$noescape],
     f => [qw(f force), \$force],
     i => [qw(i inpipe), \$inpipe, 1],
     I => [qw(I infail), \$infail],

Mpp/Glob.pm  view on Meta::CPAN


   **/xyz/../*.cxx

In theory, this should find all .cxx files in directories that have a
subdirectory called xyz.  This won't work with wildcard_do (it'll work fine
with zglob_fileinfo above, however).  wildcard_do emits a warning message in
this case.

=cut

sub wildcard_do(&@) {
  my( $subr, $flags ) = splice @_, 0, ref( $_[1] ) ? 2 : 1;
  my ( $last_chance, $no_phony ) = ($$flags & 1, $$flags & 2 ? 0 : undef)
    if $flags;
  my $member = $last_chance ? 'LAST_CHANCE' : 'WILDCARD_DO';

#
# We first call the subroutine immediately with all files that we currently
# know about that match the wildcard.
#
  for my $filename (@_) {



( run in 1.568 second using v1.01-cache-2.11-cpan-49f99fa48dc )