Subject: pkg/12820: gensolpkg broken w/ current pkgsrc
To: None <gnats-bugs@gnats.netbsd.org>
From: Michael Santos <mike@ethmoid.org>
List: netbsd-bugs
Date: 05/03/2001 18:13:19
>Number:         12820
>Category:       pkg
>Synopsis:       Make gensolpkg work with current pkgsrc
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu May 03 15:13:02 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Michael Santos
>Release:        -current
>Organization:
	
>Environment:
	
System: NetBSD ack 1.5U NetBSD 1.5U (ack) #16: Sun Apr 29 21:27:55 EDT 2001 root@ack:/amd/ns/root/usr/a/src/sys/arch/i386/compile/ack i386
Architecture: i386
Machine: i386
>Description:

gensolpkg doesn't work after the COMMENT file was integrated into the pkg
Makefile.

>How-To-Repeat:

run gensolpkg w/ current pkgsrc.

>Fix:

--- gensolpkg.c.in.orig	Sun Jan 21 18:32:49 2001
+++ gensolpkg.c.in	Thu May  3 11:17:21 2001
@@ -77,4 +77,5 @@
 static char	pkgarch[16 + 1];		/* Solaris arch name - default "sparc" */
 static char	pkgversion[256 + 1];		/* version number for this package */
+static char	comment[256 + 1];		/* one line descr of pkg */
 
 static char	prefix[MAXPATHLEN];		/* current prefix */
@@ -212,5 +213,4 @@
 	time_t	t;
 	FILE	*fp;
-	FILE	*comment;
 	char	buf[BUFSIZ];
 
@@ -226,10 +226,5 @@
 	(void) fprintf(fp, "VERSION=\"%.24s\"\n", pkgversion);
 	(void) fprintf(fp, "CATEGORY=\"%s\"\n", category);
-	if ((comment = fopen("pkg/COMMENT", "r")) == (FILE *) NULL) {
-		(void) fprintf(stderr, "can't open `pkg/COMMENT'\n");
-		return 0;
-	}
-	(void) fgets(buf, sizeof(buf), comment);
-	(void) fclose(comment);
+	(void) fprintf(fp, "COMMENT=\"%s\"\n", comment);
 	(void) fprintf(fp, "DESC=\"%.*s\"\n", strlen(buf) - 1, buf);
 	(void) fprintf(fp, "CLASSES=\"none\"\n");
>Release-Note:
>Audit-Trail:
>Unformatted: