Summary: | Autounmask fails when there is no file in /etc/portage/package.*/ | ||
---|---|---|---|
Product: | Portage Development | Reporter: | terabit.funtoo |
Component: | Core | Assignee: | Portage team <dev-portage> |
Status: | RESOLVED FIXED | ||
Severity: | major | CC: | esigra, keepun |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | |||
Bug Blocks: | 376695, 604854 |
Description
terabit.funtoo
2016-10-26 11:46:59 UTC
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. *** |