Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#63422 closed defect (fixed)

xdiskusage @1.54: extraneous boxes with a "?" appended to directory names

Reported by: q2go Owned by: ryandesign (Ryan Carsten Schmidt)
Priority: Normal Milestone:
Component: ports Version: 2.7.1
Keywords: Cc:
Port: xdiskusage

Description

Hi there, I am new to MacPorts; I just installed 2.7.1 from scratch on Mojave 10.14.6 in order to install and use the xdiskusage 1.54 port.

So after installing the .pkg installation package provided on https://www.macports.org/install.php the first and only MacPort command I've ever run was "port install xdiskusage".

The /opt/local/bin/xdiskusage command does work, but for almost all directories it creates a second "phantom" box with question mark appended to the directory name.

This happens no matter whether I run "xdiskusage" (i.e. no arguments), "xdiskusage /some/path" or "df -k /some/path | xdiskusage -"; also adding a trailing slash to /some/path does not make a difference.

I wonder whether this is maybe caused by improper handling of line endings, as "echo -n '4711 local' | xdiskusage -" shows a box named "local" while the usual "echo '4711 local' | xdiskusage -" names it "local?".

Please see attached screenshots.

IMHO the purpose of "xdiskusage" — to provide a clean visual representation of file system usage — is quite significantly affected by this defect, so I set the priority to "normal" instead of "low".

Attachments (3)

Bildschirmfoto 2021-08-30 um 22.17.10.png (368.7 KB) - added by q2go 3 years ago.
Example #1: when run without arguments; directory path entered manually
Bildschirmfoto 2021-08-30 um 22.15.21.png (846.6 KB) - added by q2go 3 years ago.
Example #2: when run with arguments or fed through a pipe
Bildschirmfoto 2021-08-30 um 22.32.13.png (383.6 KB) - added by q2go 3 years ago.
Example #3: with "echo -n" and "echo"

Download all attachments as: .zip

Change History (8)

Changed 3 years ago by q2go

Example #1: when run without arguments; directory path entered manually

Changed 3 years ago by q2go

Example #2: when run with arguments or fed through a pipe

Changed 3 years ago by q2go

Example #3: with "echo -n" and "echo"

comment:1 Changed 3 years ago by jmroot (Joshua Root)

Owner: set to ryandesign
Port: xdiskusage added
Status: newassigned

comment:2 Changed 3 years ago by q2go

I just noticed that the numbers are also way too high; /opt/local/var is not 3.6 GiB in size as suggested by the "var" box — in fact the value given in the "var?" box of 397.5 MiB is exactly correct:

$ du -ks /opt/local/var/
407072	/opt/local/var/
$ bc -l
bc 1.06
Copyright 1991-1994, 1997, 1998, 2000 Free Software Foundation, Inc.
This is free software with ABSOLUTELY NO WARRANTY.
For details type `warranty'. 
407072 / 1024
397.53125000000000000000

comment:3 Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)

Status: assignedaccepted
Summary: xdiskusage 1.54: extraneous boxes with a "?" appended to directory namesxdiskusage @1.54: extraneous boxes with a "?" appended to directory names

Thank you for the detailed report and welcome to MacPorts. I had not noticed this problem before, but I do see it now on macOS 10.13.

xdiskusage works by parsing the output of df and du, which can be fragile. 1.51 and earlier, for example, didn't work on recent versions of macOS, for which I submitted a fix which appeared in 1.52.

It looks like this problem was introduced in xdiskusage 1.53; 1.52 didn't have this problem.

I'm going to guess that this is fallout from this commit which was right after 1.52 was released. There were only two other commits after that before 1.53 was released.

Since this seems like an upstream problem, I reported it to the developers so they can fix it.

comment:4 Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)

Resolution: fixed
Status: acceptedclosed

In e1312179d7c192eedbe850daecf489b85e43cce6/macports-ports (master):

xdiskusage: Update to 1.60

Closes: #63422

comment:5 Changed 3 years ago by q2go

Thank you very much for taking such quick action and making a fix available even faster than I needed it (which is today)! You and upstream rock!

(Are such "thank you!" comments appreciated here in the MacPorts Trac or rather frowned upon due to the additional notifications they create?)

Note: See TracTickets for help on using tickets.