File tree Expand file tree Collapse file tree 1 file changed +19
-11
lines changed
appimagebuilder/app_dir/deploy/pacman Expand file tree Collapse file tree 1 file changed +19
-11
lines changed Original file line number Diff line number Diff line change 1717import subprocess
1818import sys
1919from pathlib import Path
20+ from tempfile import TemporaryDirectory
2021
2122from appimagebuilder .common import shell
2223
@@ -168,18 +169,25 @@ def _configure_keyring(self):
168169 )
169170 )
170171
171- proc_gpgagent = self ._run_command (
172- "{fakeroot} {gpg-agent} --homedir {gpgdir} --daemon" ,
173- assert_success = False ,
174- wait_for_completion = False
175- )
176- self ._run_command ("{fakeroot} {pacman-key} --config {config} --init" )
177- self ._run_command (
178- "{fakeroot} {pacman-key} --config {config} --populate "
179- f"{ ' ' .join (keyrings )} "
180- )
172+ with TemporaryDirectory (prefix = "appimage-builder." ) as temp_dir :
173+ temp_gnupg_dir = str (Path (temp_dir ) / 'gnupg' )
174+
175+ os .symlink (self ._gpg_dir .absolute (), temp_gnupg_dir , target_is_directory = True )
176+
177+ proc_gpgagent = self ._run_command (
178+ "{fakeroot} {gpg-agent} --homedir"
179+ f" { temp_gnupg_dir } "
180+ " --daemon" ,
181+ assert_success = False ,
182+ wait_for_completion = False
183+ )
184+ self ._run_command ("{fakeroot} {pacman-key} --config {config} --init" )
185+ self ._run_command (
186+ "{fakeroot} {pacman-key} --config {config} --populate "
187+ f"{ ' ' .join (keyrings )} "
188+ )
181189
182- proc_gpgagent .terminate ()
190+ proc_gpgagent .terminate ()
183191
184192 def _run_command (
185193 self ,
You can’t perform that action at this time.
0 commit comments