Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 531352

Summary: PORTDIR override not respected on initial clone
Product: Portage Development Reporter: Michał Górny <mgorny>
Component: Core - ConfigurationAssignee: Portage team <dev-portage>
Status: CONFIRMED ---    
Severity: normal    
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2014-12-01 16:23:05 UTC
Normally PORTDIR can be used to override the main repository location. However, this doesn't work if there is no checkout of the repository yet and PORTDIR names the location where it is expected to be created.

$ PORTDIR=/tmp/test emerge --syn
/usr/lib64/python3.3/site-packages/portage/sync/controller.py:104: BytesWarning: str() on a bytes instance
  % (warn("*"), name,), level=logging.WARN, noiselevel=2)
>>> Synchronization of repository 'gentoo' located in '/usr/portage'...  

If /tmp/test was a valid repository, it would use it instead.
Comment 1 Zac Medico gentoo-dev 2014-12-01 16:27:46 UTC
The new portage.path.first_existing function can be used to handle cases like this. For example, os.access(first_existing(portdir), os.W_OK) can be used to check if portdir is writable or can be created.