Merge pull request #25 from hvariant/fix-package-name-quote

fix quoting of package name
pull/29/head v0.24
kewl 2019-08-31 09:02:49 +01:00 committed by GitHub
commit 9f52f507c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

3
aur.py
View File

@ -9,6 +9,7 @@ import tarfile
import os
import os.path
import tempfile
import urllib.parse
DOCUMENTATION = '''
@ -126,7 +127,7 @@ def install_with_makepkg(module, package):
Install the specified package with makepkg
"""
module.get_bin_path('fakeroot', required=True)
f = open_url('https://aur.archlinux.org/rpc/?v=5&type=info&arg={}'.format(package))
f = open_url('https://aur.archlinux.org/rpc/?v=5&type=info&arg={}'.format(urllib.parse.quote(package)))
result = json.loads(f.read().decode('utf8'))
if result['resultcount'] != 1:
return (1, '', 'package {} not found'.format(package))