Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 531352 - PORTDIR override not respected on initial clone
Summary: PORTDIR override not respected on initial clone
Status: CONFIRMED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core - Configuration (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-12-01 16:23 UTC by Michał Górny
Modified: 2014-12-01 16:27 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.