summaryrefslogtreecommitdiffstats
path: root/release
diff options
context:
space:
mode:
Diffstat (limited to 'release')
-rw-r--r--release/util.py8
1 files changed, 2 insertions, 6 deletions
diff --git a/release/util.py b/release/util.py
index df7a5638..c839b872 100644
--- a/release/util.py
+++ b/release/util.py
@@ -16,6 +16,7 @@
16 16
17import os 17import os
18import re 18import re
19import shlex
19import subprocess 20import subprocess
20import sys 21import sys
21 22
@@ -35,12 +36,7 @@ KEYID_ECC = "E1F9040D7A3F6DAFAC897CD3D3B95DA243E48A39"
35 36
36def cmdstr(cmd): 37def cmdstr(cmd):
37 """Get a nicely quoted shell command.""" 38 """Get a nicely quoted shell command."""
38 ret = [] 39 return " ".join(shlex.quote(x) for x in cmd)
39 for arg in cmd:
40 if not re.match(r"^[a-zA-Z0-9/_.=-]+$", arg):
41 arg = f'"{arg}"'
42 ret.append(arg)
43 return " ".join(ret)
44 40
45 41
46def run(opts, cmd, check=True, **kwargs): 42def run(opts, cmd, check=True, **kwargs):