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