NetBSD Problem Report #25777

Received: (qmail 21990 invoked by uid 605); 1 Jun 2004 15:28:24 -0000
Message-Id: <20040601152848.4597EAB3A@orinoco.my.domain>
Date: Wed,  2 Jun 2004 00:28:48 +0900 (JST)
From: hiramatu@boreas.dti.ne.jp
Sender: gnats-bugs-owner@NetBSD.org
Reply-To: hiramatu@boreas.dti.ne.jp
To: gnats-bugs@gnats.NetBSD.org
Subject: pkg_info shows error message when "bmake install" on Interix
X-Send-Pr-Version: 3.95

>Number:         25777
>Category:       pkg
>Synopsis:       pkg_info shows error message when "bmake install" on Interix
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    minskim
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Jun 01 15:29:00 +0000 2004
>Closed-Date:    Wed Aug 04 06:24:05 +0000 2004
>Last-Modified:  Sun Jul 01 23:30:00 +0000 2007
>Originator:     Hiramatsu Yoshifumi
>Release:        NetBSD 2.0E
>Organization:

>Environment:
Interix nile 3.5 SP-8.0.1969.1 x86 AMD Athlon/Duron
>Description:
When executing "bmake install" for a package which doesn't have DEPENDS
(i.e., devel/patch), following message is displayed.

pkg_info: missing package name(s)
usage: pkg_info [-BbcDdFfIikLmNnpqRrSsVvh] [-e package] [-l prefix]
                pkg-name [pkg-name ...]
       pkg_info -a [flags]
       pkg_info -Q variable pkg-name [pkg-name ...]

This is caused by the different behavior of xargs command. Interix's xargs
executes the command that is given as arguments even when standard input
is empty.

>How-To-Repeat:
cd /usr/pkgsrc/devel/patch
bmake install

>Fix:
This is a patch for bsd.bsd.mk.

--- bsd.pkg.mk.orig	Sat May 29 21:38:48 2004
+++ bsd.pkg.mk	Sun May 30 15:06:24 2004
@@ -4550,14 +4550,19 @@
 # dependencies are all installed.
 .PHONY: print-pkg-size-depends
 print-pkg-size-depends:
-	@${MAKE} ${MAKEFLAGS} run-depends-list				\
-	| ${XARGS} -n 1 ${SETENV} ${PKG_BEST_EXISTS}			\
-	| ${SORT} -u							\
+	@pkglist=`${MAKE} ${MAKEFLAGS} run-depends-list | sort -u`;	\
+	if [ "$${pkglist}" != "" ]; then				\
+		for i in $${pkglist}; do				\
+			${SETENV} ${PKG_BEST_EXISTS} $$i;		\
+		done							\
 	| ${XARGS} -n 256 ${SETENV} ${PKG_INFO} -qs			\
 	| ${AWK} -- 'BEGIN { print("0 "); }				\
 		/^[0-9]+$$/ { print($$1, " + "); }			\
 		END { print("p"); }'					\
-	| ${DC}
+		| ${DC};						\
+	else								\
+		echo "0";						\
+	fi								


 ###
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: pkg-manager->minskim 
Responsible-Changed-By: minskim 
Responsible-Changed-When: Wed Aug 4 06:09:27 UTC 2004 
Responsible-Changed-Why:  
I'll take this. 

From: Min Sik Kim <minskim@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:  
Subject: pr/25777 CVS commit: pkgsrc/mk
Date: Wed,  4 Aug 2004 06:22:40 +0000 (UTC)

 Module Name:	pkgsrc
 Committed By:	minskim
 Date:		Wed Aug  4 06:22:40 UTC 2004

 Modified Files:
 	pkgsrc/mk: bsd.pkg.mk

 Log Message:
 Do not run xargs if its input is an empty string; xargs in Interix
 executes the utility even in such a case.  Based on the patch provided
 by Hiramatsu Yoshifumi in PR pkg/25777.


 To generate a diff of this commit:
 cvs rdiff -r1.1482 -r1.1483 pkgsrc/mk/bsd.pkg.mk

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->closed 
State-Changed-By: minskim 
State-Changed-When: Wed Aug 4 06:23:26 UTC 2004 
State-Changed-Why:  
Fixed.  Thanks! 
From: Tobias Nygren <tnn@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: PR/25777 CVS commit: pkgsrc
Date: Sun,  1 Jul 2007 23:27:43 +0000 (UTC)

 Module Name:	pkgsrc
 Committed By:	tnn
 Date:		Sun Jul  1 23:27:43 UTC 2007

 Modified Files:
 	pkgsrc/bootstrap: bootstrap
 	pkgsrc/pkgtools/bootstrap-extras: Makefile PLIST
 Added Files:
 	pkgsrc/pkgtools/bootstrap-extras/files: xargs-sh

 Log Message:
 xargs(1) on Interix is broken. It executes the utility on the command line
 even if standard input is the empty string. Install a wrapper script
 bundled with pkgtools/bootstrap-extras to deal with this. This is an
 attempt at a permanent workaround for the problem described in PR pkg/25777
 which has regressed since it was initially fixed.

 We can now bootstrap again on Interix 3.5.


 To generate a diff of this commit:
 cvs rdiff -r1.98 -r1.99 pkgsrc/bootstrap/bootstrap
 cvs rdiff -r1.2 -r1.3 pkgsrc/pkgtools/bootstrap-extras/Makefile
 cvs rdiff -r1.1.1.1 -r1.2 pkgsrc/pkgtools/bootstrap-extras/PLIST
 cvs rdiff -r0 -r1.1 pkgsrc/pkgtools/bootstrap-extras/files/xargs-sh

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.