Blame SOURCES/perl-5.22.1-Provide-ExtUtils-MM-methods-as-standalone-ExtUtils-M.patch

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