diff options
author | svidyuk <svidyuk@yandex-team.ru> | 2022-02-10 16:47:12 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:47:12 +0300 |
commit | 287d7d8c4ffc811d1e51c756ecfb13b78f4ee62d (patch) | |
tree | 339adc63bce23800021202ae4a8328a843dc447a /build/plugins/res.py | |
parent | e23df0602fedd83374b43b6137a296baa2aad3f6 (diff) | |
download | ydb-287d7d8c4ffc811d1e51c756ecfb13b78f4ee62d.tar.gz |
Restoring authorship annotation for <svidyuk@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'build/plugins/res.py')
-rw-r--r-- | build/plugins/res.py | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/build/plugins/res.py b/build/plugins/res.py index ec8e2801f7..a937caba81 100644 --- a/build/plugins/res.py +++ b/build/plugins/res.py @@ -28,12 +28,12 @@ def split(lst, limit): yield bucket -def remove_prefix(text, prefix): - if text.startswith(prefix): - return text[len(prefix):] - return text - - +def remove_prefix(text, prefix): + if text.startswith(prefix): + return text[len(prefix):] + return text + + def onfat_resource(unit, *args): unit.onpeerdir(['library/cpp/resource']) @@ -56,7 +56,7 @@ def onresource_files(unit, *args): This macro expands into RESOURCE([DONT_PARSE] {path} resfs/file/{prefix}{path} - - resfs/src/resfs/file/{prefix}{remove_prefix(path, prefix_to_strip)}={rootrel_arc_src(path)} + - resfs/src/resfs/file/{prefix}{remove_prefix(path, prefix_to_strip)}={rootrel_arc_src(path)} ) resfs/src/{key} stores a source root (or build root) relative path of the @@ -74,7 +74,7 @@ def onresource_files(unit, *args): @see: https://wiki.yandex-team.ru/devtools/commandsandvars/resourcefiles/ """ prefix = '' - prefix_to_strip = None + prefix_to_strip = None dest = None res = [] first = 0 @@ -92,11 +92,11 @@ def onresource_files(unit, *args): prefix, dest = next(args), None elif arg == 'DEST': dest, prefix = next(args), None - elif arg == 'STRIP': - prefix_to_strip = next(args) + elif arg == 'STRIP': + prefix_to_strip = next(args) else: path = arg - key = 'resfs/file/' + (dest or (prefix + (path if not prefix_to_strip else remove_prefix(path, prefix_to_strip)))) + key = 'resfs/file/' + (dest or (prefix + (path if not prefix_to_strip else remove_prefix(path, prefix_to_strip)))) src = 'resfs/src/{}={}'.format(key, rootrel_arc_src(path, unit)) res += ['-', src, path, key] |