Ticket #149 (new defect)

Opened 8 months ago

Last modified 7 weeks ago

pkgcore needs to reload itself after upgrading/reinstalling itself

Reported by: sputnick@… Owned by:
Priority: major Milestone:
Component: pkgcore Version: 0.4.7.12
Keywords: Cc:

Description

pkgcore does not reload itself after rebuilding or upgrading itself (Portage does). This can lead to undesireable effects if more packages are merged afterwards, especially when parts of pkgcore vanished in the process.

I did observe this with a world rebuild where python got upgraded in the process, pkgcore reinstalled itself to python 2.5, unmerged itself from 2.4, and then failed to find its own scripts in following merges. This resulted in a b0rked system.

I believe similar things could happen with a normal pkgcore upgrade (without python involved) if files belonging to the older version change or get removed, and the old version continues to run (as often is the case in world upgrades).

Also the upgrade/unmerge process itself should be checked, since I believe the unmerge of the old pkgcore build failed already:

[...]
<<< file:/usr/lib64/python2.4/site-packages/pkgcore/ebuild/atom_restricts.py
<<< file:/usr/lib64/python2.4/site-packages/pkgcore/scripts/pclone_cache.py
<<< dir:/usr/lib64/python2.4/site-packages/pkgcore/bin/ebuild-helpers
<<< dir:/usr/lib64/python2.4/site-packages/pkgcore/bin/ebuild-env
<<< dir:/usr/lib64/python2.4/site-packages/pkgcore/bin
/usr/bin/python: can't open file '/usr/lib64/python2.4/site-packages/pkgcore/bin/ebuild-env/filter-env': [Errno 2] No such file or directory
/usr/bin/python: can't open file '/usr/lib64/python2.4/site-packages/pkgcore/bin/ebuild-env/filter-env': [Errno 2] No such file or directory
>>> Adding sys-apps/pkgcore-0.4.1 to world file

(full paste at http://rafb.net/p/HJ1x9S74.html)

Probably pkgcore needs to reload itself directly after installing itself, but before unmerging its old version.

Change History

comment:1 Changed 8 months ago by ferringb

  • priority changed from normal to major
  • milestone 0.4 deleted

comment:2 Changed 7 weeks ago by sprotte

  • version set to 0.4.7.12

I encountered a similar failure when doing a pmerge -uDs system.

After updating python 2.4.(4 I think) to python 2.5.2, the update halted. When calling pmerge afterwards, it just said "cannot import pkgcore, verify it is properly installed or PYTHONPATH is set correctly."

After using portage to re-emerge pkgcore, it worked again and pmerge finished the system update without problems.

I think this is related to the above, pkgcore didn't properly notice that python was updated and reinstall/reload itself. I can't find the log entry, it doesn't seem to use emerge.log.

Good work otherwise, I look forward to do more testing.

Note: See TracTickets for help on using tickets.