Subject: pkg/6481: pkg_info prints extraneous ':' after @cwd
To: None <>
From: None <>
List: netbsd-bugs
Date: 11/22/1998 08:48:06
>Number:         6481
>Category:       pkg
>Synopsis:       pkg_info prints extraneous ':' after @cwd
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    gnats-admin (GNATS administrator)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Nov 22 07:50:01 1998
>Originator:     Jim Bernard
	Speaking for myself
>Release:        November 22, 1998
System: NetBSD zoo 1.3H NetBSD 1.3H (ZOO) #0: Sun Oct 18 08:48:41 MDT 1998 local@zoo:/home/local/netbsd-current/usr/src/sys/arch/i386/compile/ZOO i386

	pkg_info prints an extraneous colon following @cwd whenever it
	prints an @cwd line.  This colon is not used in the +CONTENTS
	(PLIST) file, and its presence is contrary to the syntax used
	for output of other package "@" commands, which are shown in
	the same form used in the +CONTENTS file.

	Note that this colon was introduced fairly recently--I'm not
	sure when, but its introduction broke a script that used to
	work (which is why I noticed).

	Choose an installed package, e.g. gtk+-1.0.6.


	  pkg_info -qp gtk+-1.0.6
	     result: "@cwd: /usr/X11R6" [note the colon]
	  egrep '^@cwd' /var/db/pkg/gtk+-1.0.6/+CONTENTS
	     result: "@cwd /usr/X11R6" [note absence of colon]

	In addition:

	  pkg_info -qf gtk+-1.0.6 | diff - /var/db/pkg/gtk+-1.0.6/+CONTENTS
	     result [except for @cwd, all "@"-command lines are printed in the same form]:

*** -   Sun Nov 22 08:40:01 1998
--- /var/db/pkg/gtk+-1.0.6/+CONTENTS    Sat Nov 21 14:57:39 1998
*** 1,5 ****
  @name gtk+-1.0.6
! @cwd: /usr/X11R6
  @pkgdep gtexinfo-3.12
  @pkgcfl gtk+-1.0.0
  @pkgcfl gtk+-1.0.4
--- 1,5 ----
  @name gtk+-1.0.6
! @cwd /usr/X11R6
  @pkgdep gtexinfo-3.12
  @pkgcfl gtk+-1.0.0
  @pkgcfl gtk+-1.0.4

	Apply this patch to .../usr.sbin/pkg_install/info/show.c
	(untested, but it looks pretty obvious):
--- show.c-dist	Sat Oct 10 05:12:30 1998
+++ show.c	Sun Nov 22 08:28:45 1998
@@ -42,11 +42,11 @@
 } show_t;
 /* the entries in this table must be ordered the same as pl_ent_t constants */
 static show_t	showv[] = {
 	{	PLIST_FILE,	"%s",		"File: %s" },
-	{	PLIST_CWD,	"@cwd: %s",	"\tCWD to: %s" },
+	{	PLIST_CWD,	"@cwd %s",	"\tCWD to: %s" },
 	{	PLIST_CMD,	"@exec %s",	"\tEXEC '%s'" },
 	{	PLIST_CHMOD,	"@chmod %s",	"\tCHMOD to %s" },
 	{	PLIST_CHOWN,	"@chown %s",	"\tCHOWN to %s" },
 	{	PLIST_CHGRP,	"@chgrp %s",	"\tCHGRP to %s" },
 	{	PLIST_COMMENT,	"@comment %s",	"\tComment: %s" },