Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 256376

Summary: dispatch-conf: split files in package.keywords folder backup not handled (triggers OSError: [Errno 20] Not a directory)
Product: Portage Development Reporter: michael higgins <col>
Component: ToolsAssignee: Portage team <dev-portage>
Status: RESOLVED FIXED    
Severity: minor CC: broken.zhou, gentoo, jamesbroadhead, jd, Martin.vGagern, mgorny, pacho, waterhouse.sysmail, worklord
Priority: High Keywords: InVCS
Version: unspecified   
Hardware: x86   
OS: Linux   
See Also: https://bugs.gentoo.org/show_bug.cgi?id=837533
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 484436    
Attachments: Configuration for reprocedure

Description michael higgins 2009-01-26 02:47:53 UTC
In order to handle all the packages ~arch masked in an overlay, I've split the package.keywords file into a folder and two files.

Dispatch-conf failed to backup the merged files as, I assume, it was looking for a directory to copy into and found a file instead.

Reproducible: Didn't try

Steps to Reproduce:
1. Split files
2. backup of files in folder fails
3. (Not really sure what the portage.dispatch_conf.file_archive_post_process(archive) does)

Actual Results:  
Traceback (most recent call last):
  File "/usr/sbin/dispatch-conf", line 422, in <module>
    d.grind (portage.settings ['CONFIG_PROTECT'])
  File "/usr/sbin/dispatch-conf", line 284, in grind
    self.post_process(conf['current'])
  File "/usr/sbin/dispatch-conf", line 317, in post_process
    portage.dispatch_conf.file_archive_post_process(archive)
  File "//usr/lib/portage/pym/portage/dispatch_conf.py", line 161, in file_archive_post_process
    os.rename(archive + '.dist.new', archive + '.dist')
OSError: [Errno 20] Not a directory

Expected Results:  
no error thrown.

I don't know if creating the folder or just deleting the file is the better solution, or if it works. I'll know when it happens again, or not, the next time an update touches my package.keywords files. Either way, I guess the maintainers could look to see if that case is handled, where a user changes the file to a split set in a folder, will the backup start to fail?
Comment 1 Zac Medico gentoo-dev 2010-03-20 02:16:13 UTC
*** Bug 309599 has been marked as a duplicate of this bug. ***
Comment 2 Yichao Zhou 2013-08-17 15:50:00 UTC
A 4-year bug?

Add a sample for developer's convenience to reprocedure.  Simply extract it to a clean /etc/portage should be fine.
Comment 3 Yichao Zhou 2013-08-17 15:50:37 UTC
Created attachment 356304 [details]
Configuration for reprocedure
Comment 4 Yichao Zhou 2013-08-17 15:54:57 UTC
I think CC Wayne Davison <gentoo@blorf.net> is OK since he is in that file header.
Comment 5 Zac Medico gentoo-dev 2015-05-08 17:57:04 UTC
*** Bug 342171 has been marked as a duplicate of this bug. ***
Comment 6 Zac Medico gentoo-dev 2015-05-09 17:29:41 UTC
This could be handled in by making it rename the colliding package.keywords backup file to package.keywords.1, as it does when it is archiving a regular package.keywords file.
Comment 7 Zac Medico gentoo-dev 2015-05-09 22:59:14 UTC
*** Bug 411009 has been marked as a duplicate of this bug. ***
Comment 8 Zac Medico gentoo-dev 2015-05-09 22:59:22 UTC
*** Bug 455302 has been marked as a duplicate of this bug. ***
Comment 9 Zac Medico gentoo-dev 2015-05-10 10:07:10 UTC
There's a patch in the following branch:

https://github.com/zmedico/portage/tree/bug_256376

I've posted it for review here:

https://archives.gentoo.org/gentoo-portage-dev/message/441d778c8efbfbfb14f91f08853ab28a
Comment 11 Brian Dolbec (RETIRED) gentoo-dev 2015-05-19 19:54:40 UTC
Released in portage-2.2.19