Commit 676d78c3 authored by Laurent Bachelier's avatar Laurent Bachelier 🐧 Committed by hydrargyrum
Browse files

local_run: Avoid race conditions

parent c0b7557b
Pipeline #278637181 passed with stages
in 25 minutes and 22 seconds
......@@ -5,6 +5,7 @@
import os
import subprocess
import sys
import tempfile
if len(sys.argv) < 2:
print("Usage: %s SCRIPTNAME [args]" % sys.argv[0])
......@@ -38,8 +39,10 @@
os.path.join(os.environ.get('XDG_CONFIG_HOME', os.path.join(os.path.expanduser('~'), '.config')), 'weboob', 'backends')))
modpath = os.getenv('WEBOOB_MODULES', os.path.join(project, 'modules'))
with open(os.path.join(wd, 'sources.list'), 'w') as f:
with tempfile.NamedTemporaryFile(mode='w', dir=wd, delete=False) as f:
f.write("file://%s\n" % modpath)
os.rename(f.name, os.path.join(wd, 'sources.list'))
# Hide output unless there is an error
p = subprocess.Popen(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment