Subject: Re: weird output from dc when installing pkg games/frotz
To: Olaf Seibert <rhialto@polderland.nl>
From: Frederick Bruckman <fb@enteract.com>
List: current-users
Date: 10/11/2000 08:26:12
On Wed, 11 Oct 2000, Olaf Seibert wrote:

> dc: dc: dc: stack empty
> dc: dc: dc: stack empty
> dc: dc: dc: dc: dc: dc: dc: stack empty
> dc: dc: stack empty
> dc: register 'e' (0145) is empty
> dc: dc: dc: stack empty
> [ more ... ]
> 
> I presume this is not normal?

The recursive sizing calculation is failing to take a too chatty
"pkg_info" into account. Three possibilities:

1) Update to the latest pkgsrc/mk; so that PKG_PATH isn't set. (But
this won't help if you have PKG_PATH set in your environment. In that
case, unset it.)

2) If you're on netbsd-1-5 or current, cvs update and make build and
make install in usr.sbin/pkg_install. (Not pulled up, yet, to
netbsd-1-4. I'm looking into that possibility, too.)

3) Help me test the following patch to bsd.pkg.mk (and not "2"). I
mostly need to verify that the "pkg_info -S" information is correct in
all cases where we pull in dependencies recursively. One possible test
might be to install arena, "make update" in png, and then verify that
"pkg_info -S arena" is really the sum of "pkg_info -s
{gettext,jpeg,libwww,png}". Even better would be test this with a
package that has extensive and multiple recursive dependencies, like
"gnome".

The first block of the block of the patch will reject if you don't
have the latest version. That's OK, because it just reapplies the
latest, backed out change.

Index: bsd.pkg.mk
===================================================================
RCS file: /cvsroot/pkgsrc/mk/bsd.pkg.mk,v
retrieving revision 1.583
diff -c -r1.583 bsd.pkg.mk
*** bsd.pkg.mk	2000/10/10 20:37:29	1.583
--- bsd.pkg.mk	2000/10/11 13:25:36
***************
*** 636,646 ****
  TYPE?=		type				# Shell builtin
  .endif # !SunOS
  
! PKG_ADD?=	PKG_DBDIR=${PKG_DBDIR} ${PKG_TOOLS_BIN}/pkg_add
! PKG_ADMIN?=	PKG_DBDIR=${PKG_DBDIR} ${PKG_TOOLS_BIN}/pkg_admin
! PKG_CREATE?=	PKG_DBDIR=${PKG_DBDIR} ${PKG_TOOLS_BIN}/pkg_create
! PKG_DELETE?=	PKG_DBDIR=${PKG_DBDIR} ${PKG_TOOLS_BIN}/pkg_delete
! PKG_INFO?=	PKG_DBDIR=${PKG_DBDIR} ${PKG_TOOLS_BIN}/pkg_info
  
  .if !defined(PKGTOOLS_VERSION)
  .if !exists(${IDENT})
--- 636,646 ----
  TYPE?=		type				# Shell builtin
  .endif # !SunOS
  
! PKG_ADD?=	PKG_PATH= PKG_DBDIR=${PKG_DBDIR} ${PKG_TOOLS_BIN}/pkg_add
! PKG_ADMIN?=	PKG_PATH= PKG_DBDIR=${PKG_DBDIR} ${PKG_TOOLS_BIN}/pkg_admin
! PKG_CREATE?=	PKG_PATH= PKG_DBDIR=${PKG_DBDIR} ${PKG_TOOLS_BIN}/pkg_create
! PKG_DELETE?=	PKG_PATH= PKG_DBDIR=${PKG_DBDIR} ${PKG_TOOLS_BIN}/pkg_delete
! PKG_INFO?=	PKG_PATH= PKG_DBDIR=${PKG_DBDIR} ${PKG_TOOLS_BIN}/pkg_info
  
  .if !defined(PKGTOOLS_VERSION)
  .if !exists(${IDENT})
***************
*** 2900,2912 ****
  # need this in a make look to prevent the shell clobbering the depends
  # also includes size of depends of depends (XXX)
  print-pkg-size-depends-help:
! 	@${ECHO} "0"
! .for dep in ${DEPENDS}
! 	@pkg="${dep:C/:.*//}";						\
! 	size=`${PKG_INFO} -qS "$$pkg"`;					\
! 	${TEST} -z "$$size" || ${ECHO} "$$size +"
! .endfor
! 	@${ECHO} "p"
  
  
  ###
--- 2900,2912 ----
  # need this in a make look to prevent the shell clobbering the depends
  # also includes size of depends of depends (XXX)
  print-pkg-size-depends-help:
! 	@${ECHO} "${DEPENDS:C/:.*//}"					\
! 	| xargs -n 1 ${SETENV}${PKG_INFO} -e				\
! 	| sort -u							\
! 	| xargs -n 1 ${SETENV} ${PKG_INFO} -qS				\
! 	| ${AWK} 'BEGIN { print("0 "); }				\
! 		  /^[0-9].*/ { print($$1, " + "); }			\
! 		  END { print("p"); }'
  
  
  ###