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