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

Bug 546176

Summary: break package merging: crash on creating ._cfg0000 symlink
Product: Portage Development Reporter: Mike Hiretsky <mh>
Component: CoreAssignee: Portage team <dev-portage>
Status: RESOLVED FIXED    
Severity: major CC: k_f, mh
Priority: Normal Keywords: InVCS
Version: 2.2   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 484436    
Attachments: Fix

Description Mike Hiretsky 2015-04-10 12:58:04 UTC
If I install package with symlink in /etc directory. (At example net-mail/mailbase-1.1), I remove symlink (/etc/pam.d/pop3s). Then emerge net-mail/mailbase-1.1. Portage creates symlink /etc/pam.d/._cfg0000_pop3s. I emerge net-mail/mailbase-1.1 again and catch Traceback.


Reproducible: Always

Steps to Reproduce:
1. emerge package with symlink in etc
2. remove this installed symlink
3. remerge this package with symlink in etc (traceback may appear this)
4. remerge this package with symlink in etc
Actual Results:  
Traceback (most recent call last):
...
TypeError: _unicode_decode() takes at least 1 argument (2 given)

Expected Results:  
Install success.

Traceback (most recent call last):
  File "/usr/lib64/python2.7/site-packages/portage/dbapi/_MergeProcess.py", line 234, in _spawn
    prev_mtimes=self.prev_mtimes, counter=counter)
  File "/usr/lib64/python2.7/site-packages/portage/dbapi/vartree.py", line 4985, in merge
    counter=counter)
  File "/usr/lib64/python2.7/site-packages/portage/dbapi/vartree.py", line 4146, in treewalk
    rval = self._merge_contents(srcroot, destroot, cfgfiledict)
  File "/usr/lib64/python2.7/site-packages/portage/dbapi/vartree.py", line 4424, in _merge_contents
    self.settings["EPREFIX"].lstrip(os.sep), cfgfiledict, mymtime):
  File "/usr/lib64/python2.7/site-packages/portage/dbapi/vartree.py", line 4616, in mergeme
    myrealdest, mydmode, destmd5, mydest_link)
  File "/usr/lib64/python2.7/site-packages/portage/dbapi/vartree.py", line 4918, in _protect
    force=force)
  File "/usr/lib64/python2.7/site-packages/portage/util/__init__.py", line 1704, in new_protect_filename
    encoding=_encodings['merge'], errors='replace')
TypeError: _unicode_decode() takes at least 1 argument (2 given)
Comment 1 Mike Hiretsky 2015-04-10 12:59:21 UTC
Created attachment 400960 [details, diff]
Fix

May be missing "old_pfile" as first param for _unicode_decode.
Comment 2 Zac Medico gentoo-dev 2015-04-10 17:20:28 UTC
Your patch is in the following branch:

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

I've posted it for review here:

http://thread.gmane.org/gmane.linux.gentoo.portage.devel/5440/focus=5441
Comment 4 Brian Dolbec (RETIRED) gentoo-dev 2015-05-19 19:40:13 UTC
Released in portage-2.2.19
Comment 5 Mike Gilbert gentoo-dev 2015-06-14 16:27:57 UTC
*** Bug 552104 has been marked as a duplicate of this bug. ***