mirror of
https://git.yoctoproject.org/poky
synced 2026-05-30 12:29:55 +00:00
lib: package: Add file_reverse_translate
Adds API to reverse the removal of special characters from file names so it can be correctly done in multiple places without open-coding it. Replace the translation done in the package_rpm.bbclass with the new API (From OE-Core rev: 4cb7e93c624987d146aaf626ce8e99568e938a70) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
af6d28d2b0
commit
242be0888c
+19
-6
@@ -195,14 +195,27 @@ def strip_execs(pn, dstdir, strip_cmd, libdir, base_libdir, max_process, qa_alre
|
||||
|
||||
oe.utils.multiprocess_launch_mp(runstrip, sfiles, max_process)
|
||||
|
||||
TRANSLATE = (
|
||||
("@", "@at@"),
|
||||
(" ", "@space@"),
|
||||
("\t", "@tab@"),
|
||||
("[", "@openbrace@"),
|
||||
("]", "@closebrace@"),
|
||||
("_", "@underscore@"),
|
||||
)
|
||||
|
||||
def file_translate(file):
|
||||
ft = file.replace("@", "@at@")
|
||||
ft = ft.replace(" ", "@space@")
|
||||
ft = ft.replace("\t", "@tab@")
|
||||
ft = ft.replace("[", "@openbrace@")
|
||||
ft = ft.replace("]", "@closebrace@")
|
||||
ft = ft.replace("_", "@underscore@")
|
||||
ft = file
|
||||
for s, replace in TRANSLATE:
|
||||
ft = ft.replace(s, replace)
|
||||
|
||||
return ft
|
||||
|
||||
def file_reverse_translate(file):
|
||||
ft = file
|
||||
for s, replace in reversed(TRANSLATE):
|
||||
ft = ft.replace(replace, s)
|
||||
|
||||
return ft
|
||||
|
||||
def filedeprunner(arg):
|
||||
|
||||
Reference in New Issue
Block a user