The sp-download program

sp-download [$SP_ROOT]/package/admin/foo-2.0 [...]

sp-download downloads one or more package tarballs. It is typically invoked by way of sp-unpack. To find /package/admin/foo-2.0, it looks for /package/admin/foo/package/url_src, reads a URL from that file, substitutes the version numer 2.0 for any occurrences of the string "%{VERSION}", and downloads the tarball from the resulting URL.

The tarball is stored in "$SP_TARDIR_FLAT", if that variable is set, or "$SP_TARDIR/admin", if that variable is set, or else "$SP_ROOT/usr/local/src/package/admin".

If the tarball already exists locally in any of the above directories, sp-download will not download the tarball again. If $SP_OFFLINE_SRC is set to "y", sp-download will fail instead of downloading if the tarball does not already exist locally.