How to download macports packages separately? I would like to download an extensive list of macports packages through an accelerator and install them offline.

Using the following command, the list of packages required was obtained,

 port echo rpedof:&lt;pkg_name&gt; and not installed


But I'm not sure how to proceed beyond that. I could painstakingly find the port for each one, but there far too many.

All I require is to have an output in the form of lists of urls for each dependant package. I'll be able to do the rest with download scripts.

Is there any way to do this?
You can use port fetch rdepof:$pkgname and not installed to trigger only downloading source code. Given that you want to use download accelerators, that probably doesn't do what you want.

If you just want to get the URLs for downloading, see port distfiles rdepof:$pkgname and not installed and parse its output. Note that you may have to deal with ports fetching source code from Git/Subversion/etc.

You can use a script I wrote a while ago as a starting point; it already parses the output correctly and initiates the download (using curl), however it downloads every URL in the mirror list, not only one of them. The script is at https://trac.macports.org/browser/contrib/port-checkmirrors/port-checkmirrors.