portmaster -aftv
Something like this might do the trick (sh(1)/bash(1)):Does anyone have a script or know of a simple way to fetch distfiles for all packages currently installed?
# for port in $(pkg info -oa | tr -s ' ' | cut -f2 -d' '); do make -C /usr/ports/$port fetch-recursive; done
# for port in $( pkg query -a '%o' ); do make -C /usr/ports/$port fetch-recursive; done
fetch-recursive
as you also want to get the build dependencies if you plan on using the distfiles to build from ports. fetch-recursive Fetch the distfiles of the port and all its
dependencies.
Maybe, not sure if that would pick up all build dependencies of the 'prime' dependencies correctly. And it doesn't matter if it tries to fetch the same file multiple times, the second fetch would find the file is already there and not download it again.Shouldn't thepkg prime-origins
list be sufficient if using fetch-recursive?