d35ea2
From 9575301256f67116eccdbb99b38fc804ba3dcf53 Mon Sep 17 00:00:00 2001
d35ea2
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
d35ea2
Date: Mon, 18 Apr 2016 16:24:03 +0200
d35ea2
Subject: [PATCH] Provide ExtUtils::MM methods as standalone
d35ea2
 ExtUtils::MM::Utils
d35ea2
MIME-Version: 1.0
d35ea2
Content-Type: text/plain; charset=UTF-8
d35ea2
Content-Transfer-Encoding: 8bit
d35ea2
d35ea2
If you cannot afford depending on ExtUtils::MakeMaker, you can
d35ea2
depend on ExtUtils::MM::Utils instead.
d35ea2
d35ea2
<https://bugzilla.redhat.com/show_bug.cgi?id=1129443>
d35ea2
d35ea2
Signed-off-by: Petr Písař <ppisar@redhat.com>
d35ea2
---
d35ea2
 MANIFEST                                         |  1 +
d35ea2
 cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM/Utils.pm | 68 ++++++++++++++++++++++++
d35ea2
 2 files changed, 69 insertions(+)
d35ea2
 create mode 100644 cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM/Utils.pm
d35ea2
d35ea2
diff --git a/MANIFEST b/MANIFEST
d35ea2
index 6af238c..d4f0c56 100644
d35ea2
--- a/MANIFEST
d35ea2
+++ b/MANIFEST
d35ea2
@@ -784,6 +784,7 @@ cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_OS2.pm			MakeMaker methods for OS/2
d35ea2
 cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_OS2.pm			MakeMaker methods for OS/2
d35ea2
 cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_QNX.pm			MakeMaker methods for QNX
d35ea2
 cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm			MakeMaker methods for Unix
d35ea2
+cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM/Utils.pm		Independed MM methods
d35ea2
 cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_UWIN.pm			MakeMaker methods for U/WIN
d35ea2
 cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_VMS.pm			MakeMaker methods for VMS
d35ea2
 cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_VOS.pm			MakeMaker methods for VOS
d35ea2
diff --git a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM/Utils.pm b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM/Utils.pm
d35ea2
new file mode 100644
d35ea2
index 0000000..6bbc0d8
d35ea2
--- /dev/null
d35ea2
+++ b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM/Utils.pm
d35ea2
@@ -0,0 +1,68 @@
d35ea2
+package ExtUtils::MM::Utils;
d35ea2
+
d35ea2
+require 5.006;
d35ea2
+
d35ea2
+use strict;
d35ea2
+use vars qw($VERSION);
d35ea2
+$VERSION = '7.11_06';
d35ea2
+$VERSION = eval $VERSION;  ## no critic [BuiltinFunctions::ProhibitStringyEval]
d35ea2
+
d35ea2
+=head1 NAME
d35ea2
+
d35ea2
+ExtUtils::MM::Utils - ExtUtils::MM methods without dependency on ExtUtils::MakeMaker
d35ea2
+
d35ea2
+=head1 SYNOPSIS
d35ea2
+
d35ea2
+    require ExtUtils::MM::Utils;
d35ea2
+    MM->maybe_command($file);
d35ea2
+
d35ea2
+=head1 DESCRIPTION
d35ea2
+
d35ea2
+This is a collection of L<ExtUtils::MM> subroutines that are used by many
d35ea2
+other modules but that do not need full-featured L<ExtUtils::MakeMaker>. The
d35ea2
+issue with L<ExtUtils::MakeMaker> is it pulls in Perl header files and that is
d35ea2
+an overkill for small subroutines.
d35ea2
+
d35ea2
+An example is the L<IPC::Cmd> that caused installing GCC just because of
d35ea2
+three-line I<maybe_command()> from L<ExtUtils::MM_Unix>.
d35ea2
+
d35ea2
+The intentions is to use L<ExtUtils::MM::Utils> instead of
d35ea2
+L<ExtUtils::MakeMaker> for these trivial methods. You can still call them via
d35ea2
+L<MM> class name.
d35ea2
+
d35ea2
+=head1 METHODS
d35ea2
+
d35ea2
+=over 4
d35ea2
+
d35ea2
+=item maybe_command
d35ea2
+
d35ea2
+Returns true, if the argument is likely to be a command.
d35ea2
+
d35ea2
+=cut
d35ea2
+
d35ea2
+if (!exists $INC{'ExtUtils/MM.pm'}) {
d35ea2
+    *MM::maybe_command = *ExtUtils::MM::maybe_command = \&maybe_command;
d35ea2
+}
d35ea2
+
d35ea2
+sub maybe_command {
d35ea2
+    my($self,$file) = @_;
d35ea2
+    return $file if -x $file && ! -d $file;
d35ea2
+    return;
d35ea2
+}
d35ea2
+
d35ea2
+1;
d35ea2
+
d35ea2
+=back
d35ea2
+
d35ea2
+=head1 BUGS
d35ea2
+
d35ea2
+These methods are copied from L<ExtUtils::MM_Unix>. Other operating systems
d35ea2
+are not supported yet. The reason is this
d35ea2
+L
d35ea2
+distributions|https://bugzilla.redhat.com/show_bug.cgi?id=1129443>.
d35ea2
+
d35ea2
+=head1 SEE ALSO
d35ea2
+
d35ea2
+L<ExtUtils::MakeMaker>, L<ExtUtils::MM>
d35ea2
+
d35ea2
+=cut
d35ea2
-- 
d35ea2
2.5.5
d35ea2