Opened 10 years ago

Closed 9 years ago

#27244 closed enhancement (fixed)

base: action to show disk space used by an active port

Reported by: outis Owned by: macports-tickets@…
Priority: Normal Milestone: MacPorts 2.0.0
Component: base Version: 1.9.2
Keywords: Cc:
Port:

Description

I propose to add an action named "space" to show the disk space used by installed files in an active port. Similar information is available by running the command "du -sk /opt/local/var/macports/software/<port name>", but an action is a little handier. The total doesn't include any files used to create or keep track of the port, such as those in /opt/local/var/macports/{receipts,sources}.

The patch adds support for this action, as well as options that specify the default units for sizes: -K for KiB, -M for MiB, -B for bytes. These options are applicable to other (such as another proposed feature of mine to include file sizes when listing port contents), which is why they are global options rather than action flags. Another possible option (-H) would say to make the sizes human readable (i.e. autoscaled), picking the unit that best matches the value magnitude. As this should be the default behavior, I've left out this option for now.

Example usage:

$ port space autoconf gawk zip
2.960 MiB autoconf
5.038 MiB gawk
800.381 KiB zip
8.779 MiB total

Attachments (1)

port.tcl-space.patch (5.0 KB) - added by outis 10 years ago.
adds "space" action

Download all attachments as: .zip

Change History (4)

comment:1 Changed 10 years ago by outis

The other proposed enhancement that uses the "-[BKM]" options is ticket #27245.

Changed 10 years ago by outis

Attachment: port.tcl-space.patch added

adds "space" action

comment:2 Changed 10 years ago by jmroot (Joshua Root)

Milestone: MacPorts 2.0.0

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

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.