diff options
author | Mike Frysinger <vapier@gentoo.org> | 2010-01-17 00:44:26 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2010-01-17 00:44:26 +0000 |
commit | 57e34c46fe1f45872285059279e879099fad9107 (patch) | |
tree | 61f0808327d2933e5635fa5d139c2102deaf06e4 /sys-devel/make | |
parent | Version bump (diff) | |
download | gentoo-2-57e34c46fe1f45872285059279e879099fad9107.tar.gz gentoo-2-57e34c46fe1f45872285059279e879099fad9107.tar.bz2 gentoo-2-57e34c46fe1f45872285059279e879099fad9107.zip |
Apply patch from upstream for long command lines #301116 by Priit Laes.
(Portage version: 2.2_rc61/cvs/Linux x86_64)
Diffstat (limited to 'sys-devel/make')
-rw-r--r-- | sys-devel/make/ChangeLog | 10 | ||||
-rw-r--r-- | sys-devel/make/files/make-3.81-long-cmdline.patch | 96 | ||||
-rw-r--r-- | sys-devel/make/make-3.81-r1.ebuild | 44 |
3 files changed, 148 insertions, 2 deletions
diff --git a/sys-devel/make/ChangeLog b/sys-devel/make/ChangeLog index a30dde0b4d40..05fd1ae26045 100644 --- a/sys-devel/make/ChangeLog +++ b/sys-devel/make/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for sys-devel/make -# Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-devel/make/ChangeLog,v 1.60 2008/12/07 03:18:17 vapier Exp $ +# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/sys-devel/make/ChangeLog,v 1.61 2010/01/17 00:44:26 vapier Exp $ + +*make-3.81-r1 (17 Jan 2010) + + 17 Jan 2010; Mike Frysinger <vapier@gentoo.org> +make-3.81-r1.ebuild, + +files/make-3.81-long-cmdline.patch: + Apply patch from upstream for long command lines #301116 by Priit Laes. 07 Dec 2008; Mike Frysinger <vapier@gentoo.org> make-3.80-r4.ebuild, make-3.81.ebuild: diff --git a/sys-devel/make/files/make-3.81-long-cmdline.patch b/sys-devel/make/files/make-3.81-long-cmdline.patch new file mode 100644 index 000000000000..db7f5ca6c2ec --- /dev/null +++ b/sys-devel/make/files/make-3.81-long-cmdline.patch @@ -0,0 +1,96 @@ +http://bugs.gentoo.org/301116 + +tweaked a little to avoid regenerating autotools + +2009-07-29 Ralf Wildenhues <Ralf.Wildenhues <at> gmx.de> + + * configure.in: Check for sys/user.h and linux/binfmts.h + headers. + * job.c: Include them if available. + (construct_command_argv_internal): When constructing the command + line with 'sh -c', use multiple arguments together with eval + expansion to evade the Linux per-argument length limit + MAX_ARG_STRLEN if it is defined. + Problem reported against Automake by Xan Lopez <xan <at> gnome.org>. + +--- job.c.orig 2010-01-15 18:36:53.000000000 +0200 ++++ job.c 2010-01-15 18:41:09.000000000 +0200 +@@ -29,6 +29,11 @@ + + #include <string.h> + ++#if defined(__linux__) /* defined (HAVE_LINUX_BINFMTS_H) && defined (HAVE_SYS_USER_H) */ ++#include <sys/user.h> ++#include <linux/binfmts.h> ++#endif ++ + /* Default shell to use. */ + #ifdef WINDOWS32 + #include <windows.h> +@@ -2697,9 +2702,19 @@ + #endif + unsigned int line_len = strlen (line); + ++#ifdef MAX_ARG_STRLEN ++ static char eval_line[] = "eval\\ \\\"set\\ x\\;\\ shift\\;\\ "; ++#define ARG_NUMBER_DIGITS 5 ++#define EVAL_LEN (sizeof(eval_line)-1 + shell_len + 4 \ ++ + (7 + ARG_NUMBER_DIGITS) * 2 * line_len / (MAX_ARG_STRLEN - 2)) ++#else ++#define EVAL_LEN 0 ++#endif + char *new_line = (char *) alloca (shell_len + (sizeof (minus_c) - 1) +- + (line_len * 2) + 1); ++ + (line_len*2) + 1 + EVAL_LEN); ++ + char *command_ptr = NULL; /* used for batch_mode_shell mode */ ++ char *args_ptr; + + # ifdef __EMX__ /* is this necessary? */ + if (!unixy_shell) +@@ -2712,6 +2727,30 @@ + bcopy (minus_c, ap, sizeof (minus_c) - 1); + ap += sizeof (minus_c) - 1; + command_ptr = ap; ++ ++#if !defined (WINDOWS32) && defined (MAX_ARG_STRLEN) ++ if (unixy_shell && line_len > MAX_ARG_STRLEN) ++ { ++ unsigned j; ++ memcpy (ap, eval_line, sizeof (eval_line) - 1); ++ ap += sizeof (eval_line) - 1; ++ for (j = 1; j <= 2 * line_len / (MAX_ARG_STRLEN - 2); j++) ++ ap += sprintf (ap, "\\$\\{%u\\}", j); ++ *ap++ = '\\'; ++ *ap++ = '"'; ++ *ap++ = ' '; ++ /* Copy only the first word of SHELL to $0. */ ++ for (p = shell; *p != '\0'; ++p) ++ { ++ if (isspace ((unsigned char)*p)) ++ break; ++ *ap++ = *p; ++ } ++ *ap++ = ' '; ++ } ++#endif ++ args_ptr = ap; ++ + for (p = line; *p != '\0'; ++p) + { + if (restp != NULL && *p == '\n') +@@ -2760,6 +2799,14 @@ + } + #endif + *ap++ = *p; ++ ++#if !defined (WINDOWS32) && defined (MAX_ARG_STRLEN) ++ if (unixy_shell && line_len > MAX_ARG_STRLEN && (ap - args_ptr > MAX_ARG_STRLEN - 2)) ++ { ++ *ap++ = ' '; ++ args_ptr = ap; ++ } ++#endif + } + if (ap == new_line + shell_len + sizeof (minus_c) - 1) + /* Line was empty. */ diff --git a/sys-devel/make/make-3.81-r1.ebuild b/sys-devel/make/make-3.81-r1.ebuild new file mode 100644 index 000000000000..d0de5ccc2925 --- /dev/null +++ b/sys-devel/make/make-3.81-r1.ebuild @@ -0,0 +1,44 @@ +# Copyright 1999-2010 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-devel/make/make-3.81-r1.ebuild,v 1.1 2010/01/17 00:44:26 vapier Exp $ + +inherit flag-o-matic + +DESCRIPTION="Standard tool to compile source trees" +HOMEPAGE="http://www.gnu.org/software/make/make.html" +SRC_URI="mirror://gnu//make/${P}.tar.bz2" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~sparc-fbsd ~x86-fbsd" +IUSE="nls static" + +DEPEND="nls? ( sys-devel/gettext )" +RDEPEND="nls? ( virtual/libintl )" + +src_unpack() { + unpack ${A} + cd "${S}" + epatch "${FILESDIR}"/${P}-tests-lang.patch + epatch "${FILESDIR}"/${P}-long-cmdline.patch #301116 +} + +src_compile() { + use static && append-ldflags -static + econf \ + $(use_enable nls) \ + --program-prefix=g \ + || die + emake || die +} + +src_install() { + emake DESTDIR="${D}" install || die "make install failed" + dodoc AUTHORS ChangeLog NEWS README* + if [[ ${USERLAND} == "GNU" ]] ; then + # we install everywhere as 'gmake' but on GNU systems, + # symlink 'make' to 'gmake' + dosym gmake /usr/bin/make + dosym gmake.1 /usr/share/man/man1/make.1 + fi +} |