Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 16 Mar 2001 20:58:09 -0800 (PST)
From:      tkato@prontomail.ne.jp
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/25871: Update port: sysutils/xdu
Message-ID:  <200103170458.f2H4w9V40676@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         25871
>Category:       ports
>Synopsis:       Update port: sysutils/xdu
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Fri Mar 16 21:00:04 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     KATO Tsuguru
>Release:        4.2-RELEASE i386
>Organization:
>Environment:
>Description:
- Fix MASTER_SITES
- Add WWW line
- Append patch (obtained from OpenBSD) for:
        * correctly handle cumulative size for directory / rather than treat
          it as a file named "" under directory / (Seen with 'du /|xdu')
        * handle filenames with whitespace chars (but not [\r\n])

New file:
files/patch-aa

>How-To-Repeat:

>Fix:
diff -urN /usr/ports/sysutils/xdu/Makefile sysutils/xdu/Makefile
--- /usr/ports/sysutils/xdu/Makefile	Mon Apr 24 19:03:42 2000
+++ sysutils/xdu/Makefile	Sat Mar 17 13:51:59 2001
@@ -7,8 +7,9 @@
 
 PORTNAME=	xdu
 PORTVERSION=	3.0
+PORTREVISION=	1
 CATEGORIES=	sysutils
-MASTER_SITES=	ftp://ftp.arl.mil/pub/
+MASTER_SITES=	http://sd.wareonearth.com/~phil/xdu/
 EXTRACT_SUFX=	.tar.Z
 
 MAINTAINER=	ports@FreeBSD.org
diff -urN /usr/ports/sysutils/xdu/files/patch-aa sysutils/xdu/files/patch-aa
--- /usr/ports/sysutils/xdu/files/patch-aa	Thu Jan  1 09:00:00 1970
+++ sysutils/xdu/files/patch-aa	Fri Mar 16 07:21:04 2001
@@ -0,0 +1,77 @@
+--- xdu.c.orig	Mon Jun  6 04:29:23 1994
++++ xdu.c	Fri Mar 16 07:20:49 2001
+@@ -235,6 +235,7 @@
+ 	char	name[4096];
+ 	int	size;
+ 	FILE	*fp;
++	char	*p, *n;
+ 
+ 	if (strcmp(filename, "-") == 0) {
+ 		fp = stdin;
+@@ -244,11 +245,21 @@
+ 			exit(1);
+ 		}
+ 	}
++
+ 	while (fgets(buf,sizeof(buf),fp) != NULL) {
+-		sscanf(buf, "%d %s\n", &size, name);
++		p = buf;
++		while (*p && isspace(*p)) p++;
++		size = atoi(p);
++		while (*p && !isspace(*p)) p++;
++		while (*p && isspace(*p)) p++;
++		n = name;
++		while (*p && *p != '\n' && *p != '\r')
++			*n++ = *p++;
++		*n++ = '\0';
+ 		/*printf("%d %s\n", size, name);*/
+ 		parse_entry(name,size);
+ 	}
++
+ 	fclose(fp);
+ }
+ 
+@@ -269,7 +280,7 @@
+ 	length = strlen(name);
+ 	if ((length > 0) && (name[length-1] == '/')) {
+ 		/* strip off trailing / (e.g. GNU du) */
+-		name[length-1] = 0;
++		name[--length] = 0;
+ 	}
+ 
+ 	arg = 0; indx = 0;
+@@ -289,8 +300,10 @@
+ 		}
+ 		name++;
+ 	}
+-	buf[indx] = 0;
+-	path[arg++] = strdup(buf);
++	if (length) {
++		buf[indx] = 0;
++		path[arg++] = strdup(buf);
++	}
+ 	path[arg] = NULL;
+ 
+ 	addtree(&top,path,size);
+@@ -399,15 +412,15 @@
+ 
+ 	/*printf("addtree(\"%s\",\"%s\",%d)\n", top->name, path[0], size);*/
+ 
++	if (path[0] == NULL) {
++		/* end of the chain, save size */
++		top->size = size;
++		return;
++	}
++
+ 	/* check all children for a match */
+ 	for (np = top->child; np != NULL; np = np->peer) {
+ 		if (strcmp(path[0],np->name) == 0) {
+-			/* name matches */
+-			if (path[1] == NULL) {
+-				/* end of the chain, save size */
+-				np->size = size;
+-				return;
+-			}
+ 			/* recurse */
+ 			addtree(np,&path[1],size);
+ 			return;
diff -urN /usr/ports/sysutils/xdu/pkg-descr sysutils/xdu/pkg-descr
--- /usr/ports/sysutils/xdu/pkg-descr	Fri Feb 10 11:11:44 1995
+++ sysutils/xdu/pkg-descr	Fri Mar 16 07:13:52 2001
@@ -3,5 +3,7 @@
 navigate up and down in the tree, sort things, and print out
 information.
 
+WWW: http://sd.wareonearth.com/~phil/xdu/
+
 - Satoshi
 asami@cs.berkeley.edu

>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200103170458.f2H4w9V40676>