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