Wouldn't it make sense that if there is a MANIFEST.SKIP file that it would be honored by libscan() so that files that are to be skipped when validating the MANIFEST are also not included in the generated makefile rules (e.g., in the definitions of TO_INST_PM, PM_TO_BLIB) or am I misunderstanding its purpose? (I know the primary purpose for MAKEFILE.SKIP is in regards to validating the MANIFEST, but it seems to be a logical extrapolation that it should be honored when building the Makefile rules too.)

An example is temporary vim files (e.g., *.swp). If present, they're found by libscan() and included in TO_INST_PM.

The (only?) solution I've come up with is creating my own MY::libscan in Makefile.PL that filters the results from the default libscan (ExtUtils::MM_any::libscan()) using the regexp's in MAKEFILE.SKIP; like so:

# =============================================================================

my $skip;

# Exclude any files matching patterns in the MANIFEST.SKIP file from being
# included in rules in the generated Makefile.
#
sub MY::libscan
{
    unless (defined $skip) {
# Newer versions of ExtUtils define maniskip(); older versions (like
         # what we're using now) define _maniskip() -- use whatever is
         # present, preferring the newer, "public", name.
         #
         if      (defined(&ExtUtils::Manifest::maniskip )) {
              $skip = ExtUtils::Manifest::maniskip();
         } elsif (defined(&ExtUtils::Manifest::_maniskip)) {
              $skip = ExtUtils::Manifest::_maniskip();
         } else {
              $skip = undef;
         }
    }

    my $path = ExtUtils::MM_Any::libscan(@_);

    return ($skip && $skip->($path)) ? '' : $path;
}

# =============================================================================


Note that we're using an old version:

# It was generated automatically by MakeMaker version
# 6.17 (Revision: 1.133)

Although I looked at the latest version (6.50), and didn't see anything new that would honor the MANIFEST.SKIP in the building of the Makefile; apologies if I missed it.

--
Gary Holloway
Senior Software Engineer
Cast & Crew Entertainment Services, LLC.
858-565-1513 x104
<g...@castandcrew.com>

Reply via email to