A few new features for `port`

Anders F Björklund afb at macports.org
Sun Nov 7 23:59:07 PST 2010


Galen Wright-Watson wrote:

> I've a few customizations for the `port` command, and I'm getting tired of patching with each new release, so I'm offering them up for inclusion into the base, should others be interested. The attached "port.patch" contains a patch with the changes. If others are interested, what's the next step?

[...]
> New commands:
>   space/size [-KMB]: show disk space used by an active port, in KiB (-K), MiB (-M), or auto-scaled units (-B).

Some other commands, like df, use -H (human-readable) for that.
Option -B could be "bytes" instead, for non-human processing ?


If you want to provide this for uninstalled ports, there was the
(well-hidden) "distcheck.type=filesize" too. It would do a curl
"getsize" (HEAD) on the distfiles, to calculate how much that it
would have to download to do a build. And print something like:

port MacPorts: MacPorts-1.9.2.tar.bz2 771574 bytes
MacPorts: 753.5K
port gcc44: gcc-core-4.4.5.tar.bz2 26356188 bytes
port gcc44: gcc-fortran-4.4.5.tar.bz2 1414484 bytes
port gcc44: gcc-g++-4.4.5.tar.bz2 5946112 bytes
port gcc44: gcc-java-4.4.5.tar.bz2 18488619 bytes
port gcc44: gcc-objc-4.4.5.tar.bz2 240383 bytes
gcc44: 50.0M

Other ports system have that information (filesize) with the
checksums, so that they don't have to contact servers for it...
But no matter where it is retrieved from, it's useful to be
able to see how "big" ports are - also in terms of distfiles ?

checksums           size    771574 \
                    md5     a8da5dfaffe03d6f9369572f14ff085a \
                    sha1    553b2a55e970d3ed92caa634c1345054ff87cd1f \
                    sha256  fd6fb0da123f29be05a44639b120873282b5dd0aa4dabbd3aa95d9cb4e05f85d

--anders

PS. It's called "distinfo", rather than "checksums", there.
    Not sure if filesize qualifies as an actual checksum...



More information about the macports-dev mailing list