Subject: pkg/13894: pkgsrc/mk/ portability fix for show-depends-dirs target
To: None <>
From: Stoned Elipot <>
List: netbsd-bugs
Date: 09/07/2001 17:48:17
>Number:         13894
>Category:       pkg
>Synopsis:       Solaris' /bin/sh does not seems to like a `for' with an empty list
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Sep 07 08:49:00 PDT 2001
>Originator:     Stoned Elipot
>Release:        pkgsrc-current
SCRIPT, Paris VII University, France
System: SunOS deep-space-9 5.8 Generic_108528-07 sun4u sparc SUNW,Ultra-60
Solaris' /bin/sh does not seems to like a `for' with an empty list. When
target show-depends-dirs is called in a pkg source directory and no dependencies
exist the for loop on dependencies as no words list to operate on so /bin/sh
run bmake show-depends-dirs in say pkgsrc/editors/vim-share on Solaris/Zoularis
the following patch fix this:

RCS file: /cvsroot/pkgsrc/mk/,v
retrieving revision 1.804
diff -u -r1.804
---	2001/08/27 15:05:54	1.804
+++	2001/09/07 15:38:36
@@ -1286,8 +1286,9 @@
 	${_PKG_SILENT}${_PKG_DEBUG}                                     \
-	for reldir in ${DEPENDS:C/^[^:]*://:C/:.*$//} ${BUILD_DEPENDS:C/^[^:]*://:C/:.*$//} ;\
+	for reldir in ${DEPENDS:C/^[^:]*://:C/:.*$//} ${BUILD_DEPENDS:C/^[^:]*://:C/:.*$//} "" ;\
 	do \
+		if [ "X$$reldir" = X"" ]; then continue; fi;\
 		cd $$thisdir/$$reldir ;\
 		PWD=`pwd` ;\
 		d=`dirname $$PWD` ;\