The PORTDIR variable was used to point to the main package repository hosted on the system. It has since been in favor of the
location attribute (whose default value is /var/db/repos/gentoo) of the Gentoo repository configuration inside /etc/portage/repos.conf.
The current value of the
location attribute can be obtained by using portageq:
portageq get_repo_path / gentoo