mirror of
https://git.yoctoproject.org/poky
synced 2026-06-01 13:09:50 +00:00
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>
This commit is contained in:
+3
-3
@@ -19,7 +19,7 @@ import tempfile
|
|||||||
import configparser
|
import configparser
|
||||||
import re
|
import re
|
||||||
import copy
|
import copy
|
||||||
import pipes
|
import shlex
|
||||||
import shutil
|
import shutil
|
||||||
from string import Template
|
from string import Template
|
||||||
from functools import reduce
|
from functools import reduce
|
||||||
@@ -1275,7 +1275,7 @@ def apply_commit(parent, rev, largs, wargs, dest_dir, file_filter=None):
|
|||||||
target = os.path.join(wargs["destdir"], dest_dir)
|
target = os.path.join(wargs["destdir"], dest_dir)
|
||||||
if not os.path.isdir(target):
|
if not os.path.isdir(target):
|
||||||
os.makedirs(target)
|
os.makedirs(target)
|
||||||
quoted_target = pipes.quote(target)
|
quoted_target = shlex.quote(target)
|
||||||
# os.sysconf('SC_ARG_MAX') is lying: running a command with
|
# os.sysconf('SC_ARG_MAX') is lying: running a command with
|
||||||
# string length 629343 already failed with "Argument list too
|
# string length 629343 already failed with "Argument list too
|
||||||
# long" although SC_ARG_MAX = 2097152. "man execve" explains
|
# 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):
|
|||||||
unquoted_args = []
|
unquoted_args = []
|
||||||
cmdsize = 100 + len(quoted_target)
|
cmdsize = 100 + len(quoted_target)
|
||||||
while update:
|
while update:
|
||||||
quoted_next = pipes.quote(update[0])
|
quoted_next = shlex.quote(update[0])
|
||||||
size_next = len(quoted_next) + len(dest_dir) + 1
|
size_next = len(quoted_next) + len(dest_dir) + 1
|
||||||
logger.debug('cmdline length %d + %d < %d?' % (cmdsize, size_next, os.sysconf('SC_ARG_MAX')))
|
logger.debug('cmdline length %d + %d < %d?' % (cmdsize, size_next, os.sysconf('SC_ARG_MAX')))
|
||||||
if cmdsize + size_next < max_cmdsize:
|
if cmdsize + size_next < max_cmdsize:
|
||||||
|
|||||||
Reference in New Issue
Block a user