--autounmask-write fails with the following error:
The following problems occurred while writing autounmask changes:
!!! No file to write for '/etc/portage/package.keywords'
# file /etc/portage/package.keywords
there was no file in /etc/portage/package.keywords/
The following fixes this condition:
# touch file etc/portage/package.keywords/somefile
Steps to Reproduce:
1.emerge a masked package with the --autounmask-write option while /etc/portage/package.keywords/ is empty
Full portage output https://paste.pound-python.org/show/2tsmRPlPsEWjaGZ3s2v9/
autounmask-changes should be written for etc-update or dispatch-conf to commit.
Talked to veremit in #gentoo-portage and a bug report was recommended for this behavior.
The function find_config_file in depgraph.py , when the file_name is a directory , it returns the last file (excluding '.','..' and '~') in the list returned by os.listdir() , it does not take into account the possibility of there not being any file at all.
In my case it was returning 'None' which was the root cause of the bug.
The following patch fixes the problem for me:
--- depgraphorig.py 2016-10-27 03:04:45.150732927 +0000
+++ depgraph.py 2016-10-27 03:01:10.630713632 +0000
@@ -8187,7 +8187,10 @@
+ if last_file_path == None:
+ with open(last_file_path,"a+") as default:
write_to_file = autounmask_write and not pretend
I have the patches in my local repo so far. Needs a bit more testing for other package.* directories still.
Fixed in portage-2.3.3:
Fixed in portage-2.3.3.
*** Bug 485346 has been marked as a duplicate of this bug. ***