diff options
Diffstat (limited to 'release/util.py')
| -rw-r--r-- | release/util.py | 8 |
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 | ||
| 17 | import os | 17 | import os |
| 18 | import re | 18 | import re |
| 19 | import shlex | ||
| 19 | import subprocess | 20 | import subprocess |
| 20 | import sys | 21 | import sys |
| 21 | 22 | ||
| @@ -35,12 +36,7 @@ KEYID_ECC = "E1F9040D7A3F6DAFAC897CD3D3B95DA243E48A39" | |||
| 35 | 36 | ||
| 36 | def cmdstr(cmd): | 37 | def 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 | ||
| 46 | def run(opts, cmd, check=True, **kwargs): | 42 | def run(opts, cmd, check=True, **kwargs): |
