pipes -> shlex
This commit is contained in:
parent
f32a205fe0
commit
a10e16a964
1 changed files with 4 additions and 4 deletions
|
@ -3,7 +3,7 @@ from bundlewrap.exceptions import BundleError
|
||||||
from bundlewrap.utils.text import force_text, mark_for_translation as _
|
from bundlewrap.utils.text import force_text, mark_for_translation as _
|
||||||
from bundlewrap.utils.remote import PathInfo
|
from bundlewrap.utils.remote import PathInfo
|
||||||
import types
|
import types
|
||||||
from pipes import quote
|
from shlex import quote
|
||||||
|
|
||||||
# Downloaded from https://github.com/bundlewrap/plugins/blob/master/item_download/items/download.py
|
# Downloaded from https://github.com/bundlewrap/plugins/blob/master/item_download/items/download.py
|
||||||
# No, we can't use plugins here, because bw4 won't support them anymore.
|
# No, we can't use plugins here, because bw4 won't support them anymore.
|
||||||
|
@ -101,16 +101,16 @@ class Download(Item):
|
||||||
elif self.attributes.get('gpg_signature_url'):
|
elif self.attributes.get('gpg_signature_url'):
|
||||||
full_signature_url = self.attributes['gpg_signature_url'].format(url=self.attributes['url'])
|
full_signature_url = self.attributes['gpg_signature_url'].format(url=self.attributes['url'])
|
||||||
signature_path = f'{self.name}.signature'
|
signature_path = f'{self.name}.signature'
|
||||||
|
|
||||||
self.node.run(f"curl -sSL {self.attributes['gpg_pubkey_url']} | gpg --import -")
|
self.node.run(f"curl -sSL {self.attributes['gpg_pubkey_url']} | gpg --import -")
|
||||||
self.node.run(f"curl -L {full_signature_url} -o {quote(signature_path)}")
|
self.node.run(f"curl -L {full_signature_url} -o {quote(signature_path)}")
|
||||||
gpg_output = self.node.run(f"gpg --verify {quote(signature_path)} {quote(self.name)}").stderr
|
gpg_output = self.node.run(f"gpg --verify {quote(signature_path)} {quote(self.name)}").stderr
|
||||||
|
|
||||||
if b'Good signature' in gpg_output:
|
if b'Good signature' in gpg_output:
|
||||||
sdict['verified'] = True
|
sdict['verified'] = True
|
||||||
else:
|
else:
|
||||||
sdict['verified'] = False
|
sdict['verified'] = False
|
||||||
|
|
||||||
return sdict
|
return sdict
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
|
Loading…
Reference in a new issue