The utime function will fail with EPERM if the caller's effective UID does not match the owner of the file. This is triggered when attempting to set the mtime of a parent directory that is owned by a different user: >>> Creating Manifest for /usr/portage/sci-biology/bwa Traceback (most recent call last): File "/usr/lib/python-exec/python3.5/ebuild", line 338, in <module> vartree=portage.db[portage.root]['vartree']) File "/usr/lib64/python3.5/site-packages/portage/package/ebuild/doebuild.py", line 1066, in doebuild return not digestgen(mysettings=mysettings, myportdb=mydbapi) File "/usr/lib64/python3.5/site-packages/portage/proxy/objectproxy.py", line 31, in __call__ return result(*args, **kwargs) File "/usr/lib64/python3.5/site-packages/portage/package/ebuild/digestgen.py", line 178, in digestgen mf.write(sign=False) File "/usr/lib64/python3.5/site-packages/portage/manifest.py", line 316, in write self._apply_max_mtime(preserved_stats, myentries) File "/usr/lib64/python3.5/site-packages/portage/manifest.py", line 390, in _apply_max_mtime os.utime(path, (max_mtime, max_mtime)) File "/usr/lib64/python3.5/site-packages/portage/__init__.py", line 259, in __call__ rval = self._func(*wrapped_args, **wrapped_kwargs) PermissionError: [Errno 1] Operation not permitted
Since the utime call is non-essential except when generating manifests for distribution via rsync, we can simply display a warning message when it fails.
There's a patch in the following branch: https://github.com/zmedico/portage/tree/bug_582388 I've posted it for review here: https://archives.gentoo.org/gentoo-portage-dev/message/844d320c43a43eb63748878c29addc8c
This is in the master branch: https://gitweb.gentoo.org/proj/portage.git/commit/?id=a4e532cee124926c63db74c5af21b4529798f2dd
Fixed in 2.3.0.