archlinux / asp

Arch Build Source Management Tool
MIT License
292 stars 33 forks source link

archweb_get_pkgbase: urlencode pkgname to allow packages containing `… #23

Closed oaken-source closed 6 years ago

oaken-source commented 6 years ago

…+` characters in the pkgname to be translated correctly

archweb_get_pkgbase currently does not urlencode the pkgname, which leads to issues for split packages like libsigc++-docs which have the character '+' in the pkgname.

for example, the following fails unexpectedly:

$ asp list-repos libsigc++-docs error: unknown package: libsigc++-docs

the attached patch against falconindy/asp.git master uses the --data-urlencode option of curl to correct this problem. The added -G switch to curl forces a GET request, because --data-urlencode implies a POST request by default.

Steps to reproduce:

$ asp list-repos libsigc++-docs error: unknown package: libsigc++-docs

or directly:

$ curl https://www.archlinux.org/packages/search/json/?q=libsigc++-docs {"num_pages": 1, "results": [], "page": 1, "version": 2, "limit": 250, "valid": true}

I reported this on the arch bug tracker, but was met with limited enthusiasm: https://bugs.archlinux.org/task/58091

falconindy commented 6 years ago

My enthusiasm knows no bounds. Pushed with a different commit message (I like my summaries at <=72 characters).

Thanks!