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