CLEAN-OLD-DISTFILES(1)
π§Ή clean-old-distfiles(1) β General Commands Manual energy β¨
okay bestie, gather round, because this little cutie from the General Commands Manual section is genuinely one of the most underrated tools in the ports world and I need you to appreciate her π
πΈ NAME πΈ
clean-old-distfiles β she removes obsolete ports distfiles, and she does it flawlessly, no cap ποΈβ¨
π¦ SYNOPSIS π¦
clean-old-distfiles [-mnvx] [-e except] [-h history] [timestamp]
π DESCRIPTION π
so here's the lore, bestie π β every single time dpb(1) gets run for a full scan of the ports(7) tree, it appends to the history log. That log is literally just a list of files sitting in the distfiles directory that are not, or are no longer, needed for building the complete tree. iconic behaviour honestly.
and listen β you can also run it solely for that purpose, just for the log, using this:
$ dpb -D HISTORY_ONLY
then, when you run clean-old-distfiles later? she reads all that info from the history log and deletes the unneeded files for you π«Ά. and the way she's so tidy β when a file gets deleted, the corresponding entry is also deleted from the history log. no crumbs left behind, periodt.
by default, clean-old-distfiles deletes all the files listed in the history log. all of them. full send π
if you give her a timestamp, she interprets it as a number of seconds since the Epoch β similar to the date(1) -r argument β and then only deletes those files that were recorded as obsolete at that time or earlier. she can also take a date in ISO8601 format, like β2023-07-01β or β2023-07-02T12:00:00Zβ π
β¨
for normal files, clean-old-distfiles verifies sha256(1) checksums prior to removal β she checks before she wrecks, iykyk π. she also removes links under by_cipher/sha256, but for those she just trusts that the checksums are accurate. (yes bestie, that's the vibe, we move π)
options are as follows, and I'm obsessed with every single one of them:
π OPTIONS π
-eexcept β read the exception list from file except. each line is the name of a file that shouldn't be removed π ββοΈ protect your faves.-hhistory β read the log from history file history instead of the default/usr/ports/distfiles/history. heads up though: this also turns on-nv, because this is a testing option π§ͺ.-mβ causesclean-old-distfilesto display the progress meter even if not on a terminal. she's showing off regardless πββοΈ-nβ don't really remove files. look but don't touch, bestie π-vβ display what will be removed, asβrm fileβlines. narration! we love a running commentary π£οΈ-xβ causesclean-old-distfilesto not display the progress meter. for when you want her to be quiet π€«
π FILES π
/usr/portsβ base of the ports tree, can be overridden with env variablePORTSDIRπ³/usr/ports/distfilesβ location of the distfiles repository, can be overridden with env variableDISTDIRπ¦/usr/ports/distfiles/historyβ log of obsolete distfiles π
π SEE ALSO π
dpb(1), sha256(1), mirroring-ports(7) β go read these too, they're all part of the same friend group π«Ά
and that's the whole page, bestie π this Debian edition is dated July 6, 2023 β go forth and clean responsibly, mwah πβ¨
π¦ where this page comes from
- nixpkgs unstable: cvs-export
- Copyright (c) 2012 Marc Espie <espie@openbsd.org>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms