git: 4d456b3a839e - main - sysutils/xdu: Switch repo and improved fix for filenames with spaces
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 28 Apr 2025 19:02:25 UTC
The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/ports/commit/?id=4d456b3a839e7c667814a6660bad1b6d77c9271a commit 4d456b3a839e7c667814a6660bad1b6d77c9271a Author: Cy Schubert <cy@FreeBSD.org> AuthorDate: 2025-04-28 18:47:15 +0000 Commit: Cy Schubert <cy@FreeBSD.org> CommitDate: 2025-04-28 19:02:08 +0000 sysutils/xdu: Switch repo and improved fix for filenames with spaces The new git repo has a fix for filenames with spaces. Their approach replaces our ten line patch with a four line patch. PR: 286197 --- sysutils/xdu/Makefile | 5 +++-- sysutils/xdu/distinfo | 5 +++-- sysutils/xdu/files/patch-xdu.c | 48 ++++++++++++------------------------------ 3 files changed, 19 insertions(+), 39 deletions(-) diff --git a/sysutils/xdu/Makefile b/sysutils/xdu/Makefile index 1d17ac35c92c..903353aeb60a 100644 --- a/sysutils/xdu/Makefile +++ b/sysutils/xdu/Makefile @@ -1,6 +1,6 @@ PORTNAME= xdu PORTVERSION= 3.0 -PORTREVISION= 5 +PORTREVISION= 6 CATEGORIES= sysutils MAINTAINER= cy@FreeBSD.org @@ -8,7 +8,8 @@ COMMENT= Graphically display output of du WWW= https://sd.wareonearth.com/~phil/xdu/ USE_GITHUB= yes -GH_ACCOUNT= vlasovskikh +GH_ACCOUNT= msvticket +GH_TAGNAME= c15d80e USES= imake xorg USE_XORG= ice sm x11 xaw xext xmu xpm xt diff --git a/sysutils/xdu/distinfo b/sysutils/xdu/distinfo index 045b0ac49c6d..1f7e6de9a50d 100644 --- a/sysutils/xdu/distinfo +++ b/sysutils/xdu/distinfo @@ -1,2 +1,3 @@ -SHA256 (vlasovskikh-xdu-3.0_GH0.tar.gz) = cb11257888997357dacaf385564fef11c58297128cd2046049c0989802f6a0dc -SIZE (vlasovskikh-xdu-3.0_GH0.tar.gz) = 12522 +TIMESTAMP = 1745866007 +SHA256 (msvticket-xdu-3.0-c15d80e_GH0.tar.gz) = 142ae064098c53e3288bd073ff97cffed2b596adc2e411d151e1a873d3691404 +SIZE (msvticket-xdu-3.0-c15d80e_GH0.tar.gz) = 12563 diff --git a/sysutils/xdu/files/patch-xdu.c b/sysutils/xdu/files/patch-xdu.c index 95380a6360ad..53dcfad3ddb1 100644 --- a/sysutils/xdu/files/patch-xdu.c +++ b/sysutils/xdu/files/patch-xdu.c @@ -1,5 +1,5 @@ ---- xdu.c.orig Sun Jun 5 21:29:23 1994 -+++ xdu.c Sun Aug 15 19:31:01 2004 +--- xdu.c.orig 2014-10-14 03:21:53.000000000 -0700 ++++ xdu.c 2025-04-28 11:49:41.485062000 -0700 @@ -20,9 +20,12 @@ * the party supplying this software to the X Consortium. */ @@ -14,39 +14,16 @@ #define MAXDEPTH 80 /* max elements in a path */ #define MAXNAME 1024 /* max pathname element length */ -@@ -235,6 +238,7 @@ - char name[4096]; +@@ -234,6 +237,7 @@ + char buf[4096]; int size; FILE *fp; + char *p, *n; if (strcmp(filename, "-") == 0) { fp = stdin; -@@ -244,11 +248,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 +283,7 @@ - length = strlen(name); +@@ -271,7 +275,7 @@ + name[length] = 0; if ((length > 0) && (name[length-1] == '/')) { /* strip off trailing / (e.g. GNU du) */ - name[length-1] = 0; @@ -54,7 +31,7 @@ } arg = 0; indx = 0; -@@ -289,8 +303,10 @@ +@@ -291,8 +295,10 @@ } name++; } @@ -67,16 +44,17 @@ path[arg] = NULL; addtree(&top,path,size); -@@ -399,15 +415,15 @@ +@@ -400,16 +406,16 @@ + struct node *np; /*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) { @@ -89,7 +67,7 @@ /* recurse */ addtree(np,&path[1],size); return; -@@ -621,7 +637,7 @@ +@@ -623,7 +629,7 @@ printf("%s %d (%.2f%%)\n", path, topp->size, 100.0*topp->size/rootp->size); } @@ -98,7 +76,7 @@ char * strdup(s) char *s; -@@ -635,7 +651,7 @@ +@@ -637,7 +643,7 @@ return cp; }