NetBSD Problem Report #31153

From www@netbsd.org  Mon Sep  5 03:06:19 2005
Return-Path: <www@netbsd.org>
Received: by narn.netbsd.org (Postfix, from userid 31301)
	id 8A8DB63B84E; Mon,  5 Sep 2005 03:06:19 +0000 (UTC)
Message-Id: <20050905030619.8A8DB63B84E@narn.netbsd.org>
Date: Mon,  5 Sep 2005 03:06:19 +0000 (UTC)
From: stuart@zeus.com
Reply-To: stuart@zeus.com
To: gnats-bugs@netbsd.org
Subject: mk/scripts/mkreadme needs to handle large file lists more intelligently
X-Send-Pr-Version: www-1.0

>Number:         31153
>Category:       pkg
>Synopsis:       mk/scripts/mkreadme needs to handle large file lists more intelligently
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    asau
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Sep 05 03:07:00 +0000 2005
>Last-Modified:  Mon Nov 02 14:08:48 +0000 2009
>Originator:     Stuart Shelton
>Release:        n/a
>Organization:
n/a
>Environment:
IRIX64 octane 6.5 07010238 IP30 mips: IRIX 6.5.28
>Description:
mk/scripts/mkreadme appears to have a couple of problems:

* It ignores an environment or mk.conf setting for $AWK
* In a couple of places it does "grep */*"-type operations, which fail with a "arg list too long" error.

The latter can be easily fixed by using ${FIND} or "for" to break up the list of files into manageable chunks.

As a suggestion for an enhancement, wouldn't it be a good idea to check for the current number of command-line arguments allowed to try to identify OS/installations likely to hit problems?  On IRIX this is "getconf ARG_MAX" - which outputs the number of allowed arguments without and additional characters or spaces.
>How-To-Repeat:
bmake readme
>Fix:

I'd propose something similar to altering line 422 to read:

cat /dev/null > $ipv6
for FILE in */*/Makefile */*/options.mk; do
    ${GREP} -l -e '^BUILD_DEFS.*=.*USE_INET6' -e '^PKG_SUPPORTED_OPTIONS.*=.*inet6' $FILE | ${SED} -e 's;Makefile;;g' -e 's;options.mk;;g' >> $ipv6
done

... and changing lines 451-452 to:

    for d in `${FIND} -type d -maxdepth 2` ; do
        if [ ! -f ${d}/Makefile -a -f ${d}/README.html ]; then

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: pkg-manager->asau
Responsible-Changed-By: asau@NetBSD.org
Responsible-Changed-When: Mon, 02 Nov 2009 14:08:48 +0000
Responsible-Changed-Why:
I'll have a look.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.