The question should probably be more like: "How do I get Portage to download package sources, and do nothing more?". The reason why it doesn't work using emerge
is because that's how emerge is designed. emerge is simply not the right tool for doing this kind of job and hopefully will never be. To actually accomplish what you want, you have to use ebuild
command (man 1 ebuild
), like this:
ebuild <PATH_TO_EBUILD> fetch
This command downloads (and verifies) everything in $SRC_URI
to your $DISTDIR
.
To get the value of the variables:
<PATH_TO_EBUILD>
- is composed like this:
<REPO_DIR>/<CATEGORY>/<PACKAGE_NAME>/<PACKAGE_NAME>-<VERSION>.ebuild
- https://wiki.gentoo.org/wiki/Repository_format
<REPO_DIR>
:portageq get_repo_path / gentoo
$DISTDIR
:portageq distdir
To actually fetch the sources to a dir of your choosing, just spoof the $DISTDIR
var like this:
DISTDIR=<DIR> ebuild <PATH_TO_EBUILD> fetch
So if you use default portage paths and want to download sources to your home dir, issue this:
DISTDIR=~ ebuild /usr/portage/app-misc/ca-certificates/ca-certificates-20151214.3.21.ebuild fetch