From owner-freebsd-ports-bugs@FreeBSD.ORG Fri Jan 25 14:40:00 2013 Return-Path: Delivered-To: freebsd-ports-bugs@smarthost.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 82913F79 for ; Fri, 25 Jan 2013 14:40:00 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 69139F10 for ; Fri, 25 Jan 2013 14:40:00 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.6/8.14.6) with ESMTP id r0PEe0fl005362 for ; Fri, 25 Jan 2013 14:40:00 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.6/8.14.6/Submit) id r0PEe0tQ005361; Fri, 25 Jan 2013 14:40:00 GMT (envelope-from gnats) Resent-Date: Fri, 25 Jan 2013 14:40:00 GMT Resent-Message-Id: <201301251440.r0PEe0tQ005361@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Romain Tartiere Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5925BF5F for ; Fri, 25 Jan 2013 14:38:53 +0000 (UTC) (envelope-from romain@blogreen.org) Received: from marvin.blogreen.org (unknown [IPv6:2001:470:1f12:b9c::2]) by mx1.freebsd.org (Postfix) with ESMTP id D0DC3F01 for ; Fri, 25 Jan 2013 14:38:52 +0000 (UTC) Received: by marvin.blogreen.org (Postfix, from userid 1001) id 48A49CC16; Fri, 25 Jan 2013 15:38:51 +0100 (CET) Message-Id: <20130125143851.48A49CC16@marvin.blogreen.org> Date: Fri, 25 Jan 2013 15:38:51 +0100 (CET) From: Romain Tartiere To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.114 Subject: ports/175561: [patch] [bsd.pkgng.mk] Enhancement to avoid pkgng "/bin/sh: Argument list too long" X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: Romain Tartiere List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2013 14:40:00 -0000 >Number: 175561 >Category: ports >Synopsis: [patch] [bsd.pkgng.mk] Enhancement to avoid pkgng "/bin/sh: Argument list too long" >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Fri Jan 25 14:40:00 UTC 2013 >Closed-Date: >Last-Modified: >Originator: Romain Tartiere >Release: FreeBSD 9.1-STABLE amd64 >Organization: >Environment: System: FreeBSD marvin.blogreen.org 9.1-STABLE FreeBSD 9.1-STABLE #4 r245578: Fri Jan 18 00:14:39 CET 2013 root@marvin.blogreen.org:/usr/obj/usr/src/sys/MARVIN amd64 >Description: When trying to register a port with many dependencies (2141 ports in my case) using pkgng, it fails with error: ===> Registering installation for texlive-scheme-full-20110217,1 /bin/sh: Argument list too long pkg: Invalid manifest format *** [fake-pkg] Error code 74 Stop in /usr/ports/print/texlive-scheme-full. The ${ACTUAL-PACKAGE-DEPENDS} generated snippet is too long and this result in an invalid metadata file to be generated, thus making pkg fail a bit later. In my case, ${_LIB_RUN_DEPENDS} is 204172 bytes long while the max commandline length is 262144 bytes, there is therefore no much room for the rest of the arguments. However, the " " argument passed to `pkg query` prevent it from failing if ${_LIB_RUN_DEPENDS} where empty, so the test to "protect" it against that is useless. >How-To-Repeat: One can get the TeXLive ports from http://code.google.com/p/freebsd-texlive/ and try to install print/texlive-scheme-full with WITH_PKGNG=yes in /etc/make.conf. >Fix: The following patch helps avoiding this situation. --- bsd.pkgng.mk.diff begins here --- --- bsd.pkgng.mk.orig 2013-01-25 14:59:31.000000000 +0100 +++ bsd.pkgng.mk 2013-01-25 15:17:32.000000000 +0100 @@ -21,10 +21,8 @@ PLIST_REINPLACE:= ${PLIST_REINPLACE:Nstopdaemon} ACTUAL-PACKAGE-DEPENDS?= \ - if [ "${_LIB_RUN_DEPENDS}" != " " ]; then \ - ${PKG_QUERY} "%n: {origin: %o, version: \"%v\"}" " " ${_LIB_RUN_DEPENDS:C,[^:]*:([^:]*):?.*,\1,:C,${PORTSDIR}/,,} ; \ - ${PKG_QUERY} "%dn: {origin: %do, version: \"%dv\"}" " " ${_LIB_RUN_DEPENDS:C,[^:]*:([^:]*):?.*,\1,:C,${PORTSDIR}/,,} ; \ - fi + ${PKG_QUERY} "%n: {origin: %o, version: \"%v\"}" " " ${_LIB_RUN_DEPENDS:C,[^:]*:([^:]*):?.*,\1,:C,${PORTSDIR}/,,} ; \ + ${PKG_QUERY} "%dn: {origin: %do, version: \"%dv\"}" " " ${_LIB_RUN_DEPENDS:C,[^:]*:([^:]*):?.*,\1,:C,${PORTSDIR}/,,} .if !target(fake-pkg) --- bsd.pkgng.mk.diff ends here --- >Release-Note: >Audit-Trail: >Unformatted: