Sergey Matveychuk píše v út 06. 02. 2007 v 13:25 +0300:

> Yeap, a PLIST contains the file on 6.2-RELEASE here:
> 
> % pkg_info -L portupgrade-2.2.2_4,2
> Information for portupgrade-2.2.2_4,2:
> 
> Files:
> /usr/local/man/man1/pkg_deinstall.1.gz
> ...
> (null)/libdata/ldconfig/portupgrade
> 
> PREFIX has lost some way...

Looks like a bug in pkg_info. Try attached patch.

-- 
Pav Lucistnik <[EMAIL PROTECTED]>
              <[EMAIL PROTECTED]>

Squish. Larger than the normal icky things, and twice as icky.
--- show.c	Sat Jan  7 23:10:58 2006
+++ /usr/src/usr.sbin/pkg_install/info/show.c	Wed Feb  7 20:13:23 2007
@@ -213,6 +213,7 @@
 {
     PackingList p;
     Boolean ign = FALSE;
+    char *prefix = NULL;
     const char *dir = ".";
 
     if (!Quiet)
@@ -227,7 +228,12 @@
 	    break;
 
 	case PLIST_CWD:
-	    dir = p->name;
+	    if (!prefix)
+		prefix = p->name;
+	    if (p->name == NULL)
+		dir = prefix;
+	    else
+		dir = p->name;
 	    break;
 
 	case PLIST_IGNORE:
@@ -255,6 +261,7 @@
     long blksize;
     int headerlen;
     char *descr;
+    char *prefix = NULL;
 
     descr = getbsize(&headerlen, &blksize);
     if (!Quiet)
@@ -274,7 +281,12 @@
 	    break;
 
 	case PLIST_CWD:
-	    dir = p->name;
+	    if (!prefix)
+		prefix = p->name;
+	    if (p->name == NULL)
+		dir = prefix;
+	    else
+		dir = p->name;
 	    break;
 
 	case PLIST_IGNORE:
@@ -301,15 +313,21 @@
 {
     PackingList p;
     const char *dir = ".";
+    char *prefix = NULL;
     char tmp[FILENAME_MAX];
 
     if (!Quiet)
 	printf("%s%s", InfoPrefix, title);
 
     for (p = plist->head; p != NULL; p = p->next)
-	if (p->type == PLIST_CWD) 
-	    dir = p->name;
-	else if (p->type == PLIST_FILE) {
+	if (p->type == PLIST_CWD) {
+	    if (!prefix)
+		prefix = p->name;
+	    if (p->name == NULL)
+		dir = prefix;
+	    else
+		dir = p->name;
+	} else if (p->type == PLIST_FILE) {
 	    snprintf(tmp, FILENAME_MAX, "%s/%s", dir, p->name);
 	    if (!fexists(tmp))
 		warnx("%s doesn't exist", tmp);

Attachment: signature.asc
Description: Toto je digitálně podepsaná část zprávy

Reply via email to