Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 65396 - collision-protect: invalid cwd on unmerge
Summary: collision-protect: invalid cwd on unmerge
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core (show other bugs)
Hardware: All All
: High minor (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-09-26 05:37 UTC by TGL
Modified: 2005-02-28 00:57 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
portage.py--collision-protect_restore_cwd.patch (portage.py--collision-protect_restore_cwd.patch,556 bytes, patch)
2004-09-26 05:39 UTC, TGL
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description TGL 2004-09-26 05:37:58 UTC
When using collision-protect, there is an os.chdir(srcroot) before each merge. Since this directory is destroyed soon after the merge, it can lead to an error message, like in this example:

[...]
>>> Completed installing into /var/tmp/portage/unison-2.10.2/image/

* checking 9 files for package collisions
* spend 0.17255282402 seconds checking for file collisions
>>> Merging net-misc/unison-2.10.2 to /
[...]
>>> net-misc/unison-2.10.2 merged.

 net-misc/unison
    selected: 2.9.1-r1
   protected: 2.10.2
     omitted: none

>>> 'Selected' packages are slated for removal.
>>> 'Protected' and 'omitted' packages will not be removed.

>>> Waiting 5 seconds before starting...
>>> (Control-C to abort)...
>>> Unmerging in: 5 4 3 2 1
>>> Unmerging net-misc/unison-2.9.1-r1...
No package files given... Grabbing a set.
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
[...]

An easy "fix" to avoid this error message is to save the cwd before the chdir, and restore it after the collision checking. A patch follows.
Comment 1 TGL 2004-09-26 05:39:04 UTC
Created attachment 40441 [details, diff]
portage.py--collision-protect_restore_cwd.patch
Comment 2 Brian Harring (RETIRED) gentoo-dev 2005-02-28 00:57:27 UTC
Possibly in parallel, but marius fixed this a while back.