The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Mpp::BuildCacheControl - Externally usable management commands

group 'path/to/build_cache', ...

Recursively collect all build caches which can be found in the GROUP attribute in the $Mpp::BuildCache::options_file of all the given directories. Actually the file may contain two hashes, only the last of which is read by Mpp::BuildCache::new. This function augments each object with values in the first of the two hashes, if available. After calling this function, these variables are set:

@group

This is set to a list of one or more Mpp::BuildCache objects. These have more attributes than the same objects in makepp:

    ..          The Mpp::File of the build cache directory.
    xPREFERRED  This is a preferred build cache iff this key exists.

$preferred

This is set to the number of preferred build caches in the group. These are sorted at the beginning of @group.

@unreachable (private)

This contains the directory names of caches which should have been loaded by the above logic, but weren't, possibly because the disk or server is offline.

ARGVgroups { code }

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

groupfind { code } [$try]

This function walks the virtual superposition of all caches in the group. Call code only once for every cache entry, whether it is in one cache of the group or replicated to others. The first argument to code is an array of all the absolute path names in the different caches, virtually pointing to the same directory. The list is in the same order as @group. The second arg is the path to the current file, relative to the cache root.

group must have been called for this to work, even if the "group" consists of only one build cache. The subdir we are currently inspecting relative to the build cache root is in $try, and gets automatically added during the recursive descent.

In addition to the parameters passed to code there are some global variables:

$_

This holds the name of the current file. Mapping the concatenation of this to the list of dirs gives the pathes to the replicates.

@lstats

This is a list of arrays containing the list returned by lstat. The list is in the same order as @group. For inexistent files this contains undef instead of an array. For symbolic links this contains ext-links, i.e. nlinks-1, the number of external links instead of an array.

Two fields have non-standard meanings:

    3 EXTLINK (nlink)  Number of links to the file, not counting the one in the cache.
    6 BIUID (rdev)     The uid of the build info or undef if none.

@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.