CLEAN-OLD-DISTFILES(1)

πŸ“¦ in nixpkgs unstable

🧹 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 πŸŽ€

  • -e except β€” read the exception list from file except. each line is the name of a file that shouldn't be removed πŸ™…β€β™€οΈ protect your faves.
  • -h history β€” 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 β€” causes clean-old-distfiles to 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 β€” causes clean-old-distfiles to 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 variable PORTSDIR 🌳
  • /usr/ports/distfiles β€” location of the distfiles repository, can be overridden with env variable DISTDIR πŸ“¦
  • /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
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms