pure-data / deken

Externals wrangler for Pure Data
Other
145 stars 17 forks source link

cmdline search for packages without version fails #257

Closed umlaeute closed 2 years ago

umlaeute commented 2 years ago

i can search for the Sources of a package:

$ deken find --arch=Sources zexy
zexy/2.4.1 uploaded by zmoelnigbot on 2022-02-02 17:14:25 for Sources
     URL: http://puredata.info/Members/zmoelnigbot/software/zexy/2.4.1/zexy[v2.4.1](Sources).dek
     -----------------------------------------------------------------

however, doing a generic search for all Source packages fails:

$ deken find --arch=Sources 
Traceback (most recent call last):
  File "/usr/bin/hy", line 12, in <module>
    sys.exit(hy_main())
  File "/usr/lib/python3.9/runpy.py", line 268, in run_path
    return _run_module_code(code, init_globals, run_name,
  File "/usr/lib/python3.9/runpy.py", line 97, in _run_module_code
    _run_code(code, mod_globals, init_globals,
  File "/usr/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "<<PATH>>/deken.hy", line 2038, in <module>
    (main)
  File "<<PATH>>/deken.hy", line 2034, in main
    (if command (command arguments) (.print_help arg-parser)))
  File "<<PATH>>/deken.hy", line 1398, in find
    (find-packages searchterms
  File "<<PATH>>/deken.hy", line 1362, in find_packages
    (filter-older-versions
  File "<<PATH>>/deken.hy", line 971, in filter_older_versions
    (doit libdicts depth)
  File "<<PATH>>/deken.hy", line 965, in doit
    (+ result (cut (sorted (get pkgdict key)
TypeError: '<' not supported between instances of 'str' and 'NoneType'
umlaeute commented 2 years ago

it seems that the underlying issue is a problem with packages that lack a version number.

There is a (deken v0) gigaverb~ package for Darwin-386-32/Darwin-amd64-32/Sources but no version number, and this fails to sort.

i can also trigger the problem with other architecture, e.g.

$ deken search --libraries --arch "Darwin-i386-32" "gigaverb~"
Traceback (most recent call last):
  File "/usr/bin/hy", line 12, in <module>
    sys.exit(hy_main())
  File "/usr/lib/python3.9/runpy.py", line 268, in run_path
    return _run_module_code(code, init_globals, run_name,
  File "/usr/lib/python3.9/runpy.py", line 97, in _run_module_code
    _run_code(code, mod_globals, init_globals,
  File "/usr/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "<<PATH>>/deken.hy", line 2038, in <module>
    (main)
  File "<<PATH>>/deken.hy", line 2034, in main
    (if command (command arguments) (.print_help arg-parser)))
  File "<<PATH>>/deken.hy", line 1398, in find
    (find-packages searchterms
  File "<<PATH>>/deken.hy", line 1362, in find_packages
    (filter-older-versions
  File "<<PATH>>/deken.hy", line 971, in filter_older_versions
    (doit libdicts depth)
  File "<<PATH>>/deken.hy", line 965, in doit
    (+ result (cut (sorted (get pkgdict key)
TypeError: '<' not supported between instances of 'str' and 'NoneType'