--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 /etc/portage/package.keywords: directory there was no file in /etc/portage/package.keywords/ The following fixes this condition: # touch file etc/portage/package.keywords/somefile Reproducible: Always Steps to Reproduce: 1.emerge a masked package with the --autounmask-write option while /etc/portage/package.keywords/ is empty 2. 3. Actual Results: Full portage output https://paste.pound-python.org/show/2tsmRPlPsEWjaGZ3s2v9/ Expected Results: 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 @@ child.endswith("~"): continue stack.append(os.path.join(p, child)) - + if last_file_path == None: + last_file_path=file_path+"/"+file_name+".default" + with open(last_file_path,"a+") as default: + default.write("#"+file_name) return last_file_path 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: https://gitweb.gentoo.org/proj/portage.git/commit/?id=40e3bbe96c522eb02870550b0f976efdbdd0c033
Fixed in portage-2.3.3.
*** Bug 485346 has been marked as a duplicate of this bug. ***