Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 153905 - sys-apps/portage-2.1.2_rc1-r3 - bad magic number in /usr/lib/portage/bin/emergehelp.pyo
Summary: sys-apps/portage-2.1.2_rc1-r3 - bad magic number in /usr/lib/portage/bin/emer...
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core - Interface (emerge) (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
: 153891 154124 192619 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-11-03 01:24 UTC by Poggi Jérôme
Modified: 2007-09-15 19:19 UTC (History)
4 users (show)

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


Attachments
emerge --info (emerge.info,4.03 KB, text/plain)
2006-11-03 01:25 UTC, Poggi Jérôme
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Poggi Jérôme 2006-11-03 01:24:34 UTC
at the end of emerge =sys-apps/portage-2.1.2_rc1-r3
I get this error :
--- !empty dir /usr/lib
--- !empty dir /usr/bin
--- !empty dir /usr
--- !empty dir /etc/env.d
Traceback (most recent call last):
  File "/usr/bin/emerge", line 34, in ?
    import emergehelp, xpak, commands, errno, re, socket, string, time, types
ImportError: Bad magic number in /usr/lib/portage/bin/emergehelp.pyo

and emerge command is breaked

root@efflam:~ # emerge portage x11-wm/compiz sys-apps/baselayout
Traceback (most recent call last):
  File "/usr/bin/emerge", line 34, in ?
    import emergehelp, xpak, commands, errno, re, socket, string, time, types
ImportError: Bad magic number in /usr/lib/portage/bin/emergehelp.pyo

---
I found a workaround :
# ebuild /usr/portage/sys-apps/portage/portage-2.1.2_rc1-r3.ebuild unpack
# ebuild /usr/portage/sys-apps/portage/portage-2.1.2_rc1-r3.ebuild compile
# cp /var/tmp/portage/sys-apps/portage-2.1.2_rc1-r3/work/portage-2.1.2_rc1/pym/emergehelp.py  /usr/lib/portage/bin/

and now emerge work better :-)
Comment 1 Poggi Jérôme 2006-11-03 01:25:00 UTC
Created attachment 101130 [details]
emerge --info
Comment 2 Bob Reveley 2006-11-03 01:55:02 UTC
My merge ended ok and I was able to do etc-update but subsequent emerge commands failed with the same error:

<<<        dir /usr/share/doc/portage-2.1.2_rc1-r1
--- !empty dir /usr/share/doc
--- !empty dir /usr/share
--- !empty dir /usr/sbin
--- !empty dir /usr/lib/portage/pym/elog_modules
--- !empty dir /usr/lib/portage/pym/cache
--- !empty dir /usr/lib/portage/pym
--- !empty dir /usr/lib/portage/bin
--- !empty dir /usr/lib/portage
--- !empty dir /usr/lib
--- !empty dir /usr/bin
--- !empty dir /usr
--- !empty dir /etc/env.d
>>> Auto-cleaning packages...

>>> No outdated packages were found on your system.


 * GNU info directory index is up-to-date.
 * IMPORTANT: 1 config files in '/etc' need updating.
 * Type emerge --help config to learn how to update config files.

localhost ~ # etc-update
Scanning Configuration files...
Automerging trivial changes in: /etc/dispatch-conf.conf
Exiting: Nothing left to do; exiting. :)
localhost ~ # emerge -uDvp world
Traceback (most recent call last):
  File "/usr/bin/emerge", line 34, in ?
    import emergehelp, xpak, commands, errno, re, socket, string, time, types
ImportError: Bad magic number in /usr/lib/portage/bin/emergehelp.pyo
Comment 3 Zac Medico gentoo-dev 2006-11-03 02:19:38 UTC
*** Bug 153891 has been marked as a duplicate of this bug. ***
Comment 4 Zac Medico gentoo-dev 2006-11-03 02:30:20 UTC
This bug is strange because emergehelp.pyo shouldn't even exist inside /usr/lib/portage/bin/.  It really belongs in /usr/lib/portage/pym/.
Comment 5 Poggi Jérôme 2006-11-03 02:35:30 UTC
hmmm yes it's strange, and I seem to be a very old file :
root@efflam:~ # ls -al /usr/lib/portage/bin/emergehelp.*
-rw-r--r-- 1 root root 21790 Sep 11  2003 /usr/lib/portage/bin/emergehelp.pyc
-rw-r--r-- 1 root root 20860 Sep 11  2003 /usr/lib/portage/bin/emergehelp.pyo
(it's a ls before the workaround)

Now the ls give me this :
root@efflam:/ # ls -al /usr/lib/portage/bin/emergehelp.*
-rw-r--r-- 1 portage portage 26371 Nov  3 10:12 /usr/lib/portage/bin/emergehelp.py
-rw-r--r-- 1 root    root    21790 Sep 11  2003 /usr/lib/portage/bin/emergehelp.pyc
-rw-r--r-- 1 root    root    25487 Nov  3 10:14 /usr/lib/portage/bin/emergehelp.pyo
Comment 6 Michael Baer 2006-11-03 02:53:01 UTC
On my old system (older than 3 years) I had the same problem.
On my new system (about 2 weeks), the files do not exist:

[new_system] ls /usr/lib/portage/bin/emergehelp*
ls: cannot access /usr/lib/portage/bin/emergehelp*: No such file or directory

And equery agrees with my new system:
[old_system] equery f portage | grep emergehelp
/usr/lib/portage/pym/emergehelp.py

The silly question is: Why uses emerge these files anyway?

I'm thinking about a "brute force repair": Creating a tbz2-package of portage, removing all folders and untaring the tbz2-package to /-dir.
Seems to be the quickest way for me as I'm too lazy to remove all the unneeded files manually.
Comment 7 Zac Medico gentoo-dev 2006-11-03 03:05:34 UTC
I've fixed the ebuild to clean /usr/lib/portage/bin/*.pyo during preinst.  That should solve the problem.

(In reply to comment #6)
> The silly question is: Why uses emerge these files anyway?

Apparently it's a side-effect from the way that python loads modules.
Comment 8 David Girault 2006-11-03 15:08:25 UTC
Same error here.
Manually removing emergehelp.py* in /usr/lib/portage/bin solve the problem.

For info, these file where installed on nov 7 2003:
-rw-r--r-- 1 root root  21783 nov  7  2003 emergehelp.pyc
-rw-r--r-- 1 root root  20853 nov  7  2003 emergehelp.pyo

David

(In reply to comment #7)
> I've fixed the ebuild to clean /usr/lib/portage/bin/*.pyo during preinst.  That
> should solve the problem.
> 
> (In reply to comment #6)
> > The silly question is: Why uses emerge these files anyway?
> 
> Apparently it's a side-effect from the way that python loads modules.
> 

Comment 9 Zac Medico gentoo-dev 2006-11-04 18:17:36 UTC
(In reply to comment #8)
> Same error here.
> Manually removing emergehelp.py* in /usr/lib/portage/bin solve the problem.
> 
> For info, these file where installed on nov 7 2003:
> -rw-r--r-- 1 root root  21783 nov  7  2003 emergehelp.pyc
> -rw-r--r-- 1 root root  20853 nov  7  2003 emergehelp.pyo

Your timestamps are pretty close to those in comment #5.  Anyway, the preinst phase of the ebuild will clean those up automatically from now on.
Comment 10 Jakub Moc (RETIRED) gentoo-dev 2006-11-05 05:09:03 UTC
*** Bug 154124 has been marked as a duplicate of this bug. ***
Comment 11 Jakub Moc (RETIRED) gentoo-dev 2007-09-15 19:19:18 UTC
*** Bug 192619 has been marked as a duplicate of this bug. ***