Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 818886 - sys-apps/portage-3.0.20-r6: TypeError: '<' not supported between instances of 'str' and 'int'
Summary: sys-apps/portage-3.0.20-r6: TypeError: '<' not supported between instances of...
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks:
 
Reported: 2021-10-19 07:05 UTC by Marc Schiffbauer
Modified: 2021-12-12 20:22 UTC (History)
2 users (show)

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


Attachments
emerge --info (file_818886.txt,7.61 KB, text/plain)
2021-10-19 07:05 UTC, Marc Schiffbauer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marc Schiffbauer gentoo-dev 2021-10-19 07:05:38 UTC
Created attachment 745728 [details]
emerge --info

I am using binpkgs that I downloaded manually into the local PKGDIR from my build host.

When I just run 'emerge' I only get this:

Traceback (most recent call last):
  File "/usr/lib/python-exec/python3.9/emerge", line 51, in <module>
    retval = emerge_main()
  File "/usr/lib/python3.9/site-packages/_emerge/main.py", line 1319, in emerge_main
    return run_action(emerge_config)
  File "/usr/lib/python3.9/site-packages/_emerge/actions.py", line 2956, in run_action
    mytrees['bintree'].populate(
  File "/usr/lib/python3.9/site-packages/portage/dbapi/bintree.py", line 628, in populate
    update_pkgindex = self._populate_local(
  File "/usr/lib/python3.9/site-packages/portage/dbapi/bintree.py", line 814, in _populate_local
    if build_id < 1:
TypeError: '<' not supported between instances of 'str' and 'int'



Adding a "print(build_id)" above line 814 will show a long list of integer build_ids but "1.1" as last value before the traceback.
Comment 1 Marc Schiffbauer gentoo-dev 2021-10-19 07:15:53 UTC
The package causing this is:

/usr/portage/packages/sys-devel/llvm/llvm-11.1.0-1.1.xpak

~ # find /usr/portage/packages/ -name "llvm-11.1.0-1*.xpak"
/usr/portage/packages/sys-devel/llvm/llvm-11.1.0-1.1.xpak
/usr/portage/packages/sys-devel/llvm/llvm-11.1.0-1.xpak
Comment 2 Marc Schiffbauer gentoo-dev 2021-11-04 05:59:27 UTC
The problematic file "/usr/portage/packages/sys-devel/llvm/llvm-11.1.0-1.1.xpak" seems to have been created by the download-tool (aria2c) that I was using to mirror the binpkgs while I had good internet access, so I could install the packages later.

However: portage should handle this kind of bad filenames by ignoring the file and print a warning instead of throwing a backtrace.
Comment 3 Holger Hoffstätte 2021-11-26 11:35:43 UTC
I have just encountered the same problem, but by installing gentoo-kernel-bin. This downloads & installs "gentoo-kernel-5.15.5-1.amd64.xpak", which completes fine; afterwards portage is broken as long as that file exists in the download directory. Removing it gets things going again.
Comment 4 Larry the Git Cow gentoo-dev 2021-11-26 21:09:01 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/portage.git/commit/?id=0009404ee5f293fe7076d59a52c46827c3b77738

commit 0009404ee5f293fe7076d59a52c46827c3b77738
Author:     Mike Gilbert <floppym@gentoo.org>
AuthorDate: 2021-11-26 17:43:45 +0000
Commit:     Mike Gilbert <floppym@gentoo.org>
CommitDate: 2021-11-26 17:43:45 +0000

    dbapi: fix logic in bintree.binarytree._parse_build_id()
    
    Resolves an error when improperly named xpak files exist in PKGDIR.
    
    Bug: https://bugs.gentoo.org/818886
    Signed-off-by: Mike Gilbert <floppym@gentoo.org>

 lib/portage/dbapi/bintree.py | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
Comment 5 Mike Gilbert gentoo-dev 2021-12-12 20:22:55 UTC
Fixed in 3.0.29.