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