diff options
author | 2023-03-04 04:57:40 +0000 | |
---|---|---|
committer | 2023-03-04 05:25:55 +0000 | |
commit | eb30619181a56cdb24a40c7ee249b177ec53b6b9 (patch) | |
tree | 10f0947aa895417d1cbf842f48625b1420fc25cf /NEWS | |
parent | portage: news: further type annotations (diff) | |
download | portage-eb30619181a56cdb24a40c7ee249b177ec53b6b9.tar.gz portage-eb30619181a56cdb24a40c7ee249b177ec53b6b9.tar.bz2 portage-eb30619181a56cdb24a40c7ee249b177ec53b6b9.zip |
repository: config: fix initial sync of (git) repositories
After bd8f9f6c590dca750285e296a6c3d530f1053d89, we started to
actually dereference the Path object on the (new) repository
location. If it doesn't exist yet, it has no owner, and
a FileNotFoundError is thrown:
```
[...]
File "/usr/lib/python3.10/site-packages/portage/repository/config.py", line 794, in _parse
repo = RepoConfig(sname, optdict, local_config=local_config)
File "/usr/lib/python3.10/site-packages/portage/repository/config.py", line 360, in __init__
elif Path(self.location).owner() not in ("root", "portage"):
File "/usr/lib/python3.10/pathlib.py", line 1103, in owner
return self._accessor.owner(self)
File "/usr/lib/python3.10/pathlib.py", line 343, in owner
return pwd.getpwuid(self.stat(path).st_uid).pw_name
FileNotFoundError: [Errno 2] No such file or directory: '/var/db/repos/foo'
```
It's fine if the repository doesn't exist yet, the intention in
ef123a214708c85f9802f2a649b93137fd2ee3be was to default to non-volatile
for such cases, so let's honour that by catching FileNotFoundError
and PermissionError.
Note that this was exposed by bd8f9f6c590dca750285e296a6c3d530f1053d89 and
the real issue was in ef123a214708c85f9802f2a649b93137fd2ee3be, but it's
worth having Fixes: tags for both as it becomes easier to understand
when it was exposed and when it was actually an issue.
Bug: https://bugs.gentoo.org/899208
Fixes: bd8f9f6c590dca750285e296a6c3d530f1053d89 ("repository: config: fix volatile detection, add missing () operator")
Fixes: ef123a214708c85f9802f2a649b93137fd2ee3be ("config: Add 'volatile' configuration option")
Closes: https://github.com/gentoo/portage/pull/1004
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'NEWS')
-rw-r--r-- | NEWS | 8 |
1 files changed, 3 insertions, 5 deletions
@@ -1,11 +1,9 @@ -portage-3.0.46 (UNRELEASED) +portage-3.0.45.2 (2023-03-04) -------------- -Features: -* TODO - Bug fixes: -* TODO +* repository: config: Fix initial sync of repositories (bug #899208). Regression + from portage-3.0.45, but the real bug is from portage-3.0.42. portage-3.0.45.1 (2023-02-27) -------------- |