Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 606092 - app-portage/portpeek dies on <= entries in package.use directory files
Summary: app-portage/portpeek dies on <= entries in package.use directory files
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Mike Pagano
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-01-17 14:22 UTC by Derk W te Bokkel
Modified: 2017-01-26 11:37 UTC (History)
2 users (show)

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


Attachments
package.use directory files qt5.use causing the failure .. annotated (qt5.use,1.65 KB, text/plain)
2017-01-17 14:22 UTC, Derk W te Bokkel
Details
restore commented 2.1.18 code (portpeek-2.1.21.patch,916 bytes, patch)
2017-01-21 20:49 UTC, BobbyK
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Derk W te Bokkel 2017-01-17 14:22:24 UTC
Created attachment 460450 [details]
package.use directory files qt5.use causing the failure .. annotated

My qt5.use flag package.use directory file scan by portpeek fails unless the line with leading <= are commented out.. i also tried using just < but that also fails   .. qt5.use file is attached

command  used to determine problem

portpeek -d -s -r

package.use:
parse_package_use: Line: dev-python/PyQt5 printsupport webkit network widgets gui
ENTERED check_useflags_all_versions: dev-python/PyQt5
check_useflags_all_versions: package: dev-python/PyQt5-5.7.1
use found doc
use found sql
use found widgets
use found opengl
use found dbus
use found designer
use found positioning
use found python_targets_python3_4
use found sensors
use found location
use found serialport
use found examples
use found python_targets_python2_7
use found testlib
use found python_targets_python3_5
use found gui
use found declarative
use found help
use found xmlpatterns
use found multimedia
use found debug
use found bluetooth
use found x11extras
use found webengine
use found gles2
use found webkit
use found network
use found websockets
use found printsupport
use found svg
use found webchannel
iuse_item is abi_x86_64
iuse_item is amd64
iuse_item is bluetooth
iuse_item is dbus
iuse_item is elibc_glibc
iuse_item is gui
iuse_item is kernel_linux
iuse_item is network
iuse_item is opengl
iuse_item is printsupport
iuse_item is python_targets_python2_7
iuse_item is python_targets_python3_5
iuse_item is svg
iuse_item is userland_GNU
iuse_item is webkit
iuse_item is widgets
iuse_item is doc
iuse_item is sql
iuse_item is widgets
iuse_item is opengl
iuse_item is dbus
iuse_item is designer
iuse_item is positioning
iuse_item is python_targets_python3_4
iuse_item is sensors
iuse_item is location
iuse_item is serialport
iuse_item is examples
iuse_item is python_targets_python2_7
iuse_item is testlib
iuse_item is python_targets_python3_5
iuse_item is gui
iuse_item is declarative
iuse_item is help
iuse_item is xmlpatterns
iuse_item is multimedia
iuse_item is debug
iuse_item is bluetooth
iuse_item is x11extras
iuse_item is webengine
iuse_item is gles2
iuse_item is webkit
iuse_item is network
iuse_item is websockets
iuse_item is printsupport
iuse_item is svg
iuse_item is webchannel
package_string is dev-python/PyQt5
found valid flag: printsupport
found valid flag: webkit
found valid flag: network
found valid flag: widgets
found valid flag: gui
parse_package_use: Line: >=dev-qt/qtwebkit-5.3.2-r1 printsupport
parse_package_use: Line: >=dev-libs/libpcre-8.36 pcre16
parse_package_use: Line: >=dev-qt/qtcore-5.3.2 icu
check_useflags: package: dev-qt/qtcore-5.7.1
package_string is >=dev-qt/qtcore-5.3.2
parse_package_use: Line: <=dev-qt/qtopengl-4.9.99 qt3support
Traceback (most recent call last):
  File "/usr/lib/python-exec/python3.5/portpeek", line 1524, in <module>
    get_recursive_info(USER_CONFIG_PATH + "/package.use")
  File "/usr/lib/python-exec/python3.5/portpeek", line 431, in get_recursive_info
    get_recursive_info(filename+os.path.sep+file_name)
  File "/usr/lib/python-exec/python3.5/portpeek", line 433, in get_recursive_info
    get_info(filename)
  File "/usr/lib/python-exec/python3.5/portpeek", line 459, in get_info
    diffs_found = parse_package_use(line,filename)
  File "/usr/lib/python-exec/python3.5/portpeek", line 555, in parse_package_use
    if (pkgcmp(pkgsplit(check_pkg),pkgsplit(str(current_package.cpv))) == 1) or \
  File "/usr/lib64/python3.5/site-packages/portage/versions.py", line 293, in pkgcmp
    if pkg1[0] != pkg2[0]:
TypeError: 'NoneType' object is not subscriptable



.. commenting out the offending entries allows normal processing..
Comment 1 Derk W te Bokkel 2017-01-17 14:31:36 UTC
Comment on attachment 460450 [details]
package.use directory files qt5.use causing the failure .. annotated

the reason the following lines were added was the previous entries caused portpeek to complain that qtcore:5 etc did not support the qt3support flag
so I switched the original logic to exclude qt5 versions .. this then failed to process .. 
<=dev-qt/qtopengl-4.9.99 qt3support
<=dev-qt/qtsql-4.9.99 qt3support
<=dev-qt/qtgui-4.9.99 qt3support
<=dev-qt/qtdeclarative-4.9.99 qt3support
<=dev-qt/qtcore-4.9.99 qt3support

it also failed on the final entry
Comment 2 BobbyK 2017-01-21 20:23:13 UTC
Did some digging and it looks like the breakage is a result of a change in /usr/lib/python-exec/python2.7/portpeek, specifically the following lines (504-512) being commented out when compared to app-portage/portpeek-2.1.18:


        #else:
          #    if check_pkg[0] == '<':
          #        less_than = True;
          #        if check_pkg[1] == '=':
          #            less_than_or_equal = True
  
          #    check_pkg = check_pkg[1:]
          #    if check_pkg[0] in atom_check:
          #        check_pkg = check_pkg[1:]
  

After uncommenting these lines app-portage/portpeek-2.1.21 is once again able to check package.use files with <, >, etc.
Comment 3 BobbyK 2017-01-21 20:49:47 UTC
Created attachment 460840 [details, diff]
restore commented 2.1.18 code
Comment 4 Mike Pagano gentoo-dev 2017-01-25 19:04:31 UTC
Thanks for reporting. I will take a look and try to first figure out if there was a reason I commented those lines out.
Comment 5 Mike Pagano gentoo-dev 2017-01-25 23:24:03 UTC
Please test the fix when it shows up in your local portage tree onces the mirrors sync.

commit bfb2977fac173e845f32a048b3b982504f598489
Author: Mike Pagano <mpagano@gentoo.org>
Date:   Wed Jan 25 18:22:58 2017 -0500

    app-portage/portpeek: Fix for bug #606092, thanks to Derk for reporting and BobbyK for the analysis.
    
    Package-Manager: portage-2.3.3
Comment 6 BobbyK 2017-01-26 03:54:44 UTC
app-portage/portpeek-2.1.22 installed and works for me.

On the fix, it may be that:

          #    if check_pkg[0] == '<':
          #        less_than = True;
          #        if check_pkg[1] == '=':
          #            less_than_or_equal = True

could remain commented out, the 'less_than" and 'less_than_or_equal' variables don't seem to be used.  The magic appears to be:

              check_pkg = check_pkg[1:]
              if check_pkg[0] in atom_check:
                  check_pkg = check_pkg[1:]

removing leading modifier characters, so that check_pkg is left as an atom when used in comparisons later on.

Thanks for the quick turnaround Mike. And thanks grknight for your assistance in #gentoo.
Comment 7 Mike Pagano gentoo-dev 2017-01-26 11:37:42 UTC
Thanks for checking I will check that and remove it for the next release.