summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2023-03-14 07:26:24 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-03-14 17:13:11 +0000
commit37b5d544d34c9caaf70def0a29dfb0cf896dc1b7 (patch)
tree6dc91410f71713ed09756bb0a1f78d6991461539
parente4dc18f600d95b8a3ecfbacda42da487dd129f1d (diff)
downloadpoky-37b5d544d34c9caaf70def0a29dfb0cf896dc1b7.tar.gz
scripts/combo-layer: Fix python deprecation warning
Address: DeprecationWarning: 'pipes' is deprecated and slated for removal in Python 3.13 pipes.quote is an alias for shlex.quote so switch to that. (From OE-Core rev: 7b1c1dd9985a6f1645271a928dda7f1897a7ba8a) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rwxr-xr-xscripts/combo-layer6
1 files changed, 3 insertions, 3 deletions
diff --git a/scripts/combo-layer b/scripts/combo-layer
index 7f2020fca7..2312cef9ac 100755
--- a/scripts/combo-layer
+++ b/scripts/combo-layer
@@ -19,7 +19,7 @@ import tempfile
19import configparser 19import configparser
20import re 20import re
21import copy 21import copy
22import pipes 22import shlex
23import shutil 23import shutil
24from string import Template 24from string import Template
25from functools import reduce 25from functools import reduce
@@ -1275,7 +1275,7 @@ def apply_commit(parent, rev, largs, wargs, dest_dir, file_filter=None):
1275 target = os.path.join(wargs["destdir"], dest_dir) 1275 target = os.path.join(wargs["destdir"], dest_dir)
1276 if not os.path.isdir(target): 1276 if not os.path.isdir(target):
1277 os.makedirs(target) 1277 os.makedirs(target)
1278 quoted_target = pipes.quote(target) 1278 quoted_target = shlex.quote(target)
1279 # os.sysconf('SC_ARG_MAX') is lying: running a command with 1279 # os.sysconf('SC_ARG_MAX') is lying: running a command with
1280 # string length 629343 already failed with "Argument list too 1280 # string length 629343 already failed with "Argument list too
1281 # long" although SC_ARG_MAX = 2097152. "man execve" explains 1281 # long" although SC_ARG_MAX = 2097152. "man execve" explains
@@ -1287,7 +1287,7 @@ def apply_commit(parent, rev, largs, wargs, dest_dir, file_filter=None):
1287 unquoted_args = [] 1287 unquoted_args = []
1288 cmdsize = 100 + len(quoted_target) 1288 cmdsize = 100 + len(quoted_target)
1289 while update: 1289 while update:
1290 quoted_next = pipes.quote(update[0]) 1290 quoted_next = shlex.quote(update[0])
1291 size_next = len(quoted_next) + len(dest_dir) + 1 1291 size_next = len(quoted_next) + len(dest_dir) + 1
1292 logger.debug('cmdline length %d + %d < %d?' % (cmdsize, size_next, os.sysconf('SC_ARG_MAX'))) 1292 logger.debug('cmdline length %d + %d < %d?' % (cmdsize, size_next, os.sysconf('SC_ARG_MAX')))
1293 if cmdsize + size_next < max_cmdsize: 1293 if cmdsize + size_next < max_cmdsize: