aboutsummaryrefslogtreecommitdiffstats
path: root/build/scripts/fetch_from.py
diff options
context:
space:
mode:
authorAlexSm <alex@ydb.tech>2024-01-18 11:28:56 +0100
committerGitHub <noreply@github.com>2024-01-18 11:28:56 +0100
commit9d0a3761b3201e0d9db879a7adf91876ebdb0564 (patch)
tree541d11ac878c18efd7ebca81e35112aa0fef995b /build/scripts/fetch_from.py
parent404ef8886ecc9736bc58ade6da2fbd83b486a408 (diff)
downloadydb-9d0a3761b3201e0d9db879a7adf91876ebdb0564.tar.gz
Library import 8 (#1074)
* Library import 8 * Add contrib/libs/cxxsupp/libcxx/include/__verbose_abort
Diffstat (limited to 'build/scripts/fetch_from.py')
-rwxr-xr-xbuild/scripts/fetch_from.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/build/scripts/fetch_from.py b/build/scripts/fetch_from.py
index 2ebe6f0e51..ca3e7b3684 100755
--- a/build/scripts/fetch_from.py
+++ b/build/scripts/fetch_from.py
@@ -315,6 +315,10 @@ def chmod(filename, mode):
raise
+def make_readonly(filename):
+ chmod(filename, os.stat(filename).st_mode & 0o111 | 0o444)
+
+
def process(fetched_file, file_name, args, remove=True):
assert len(args.rename) <= len(args.outputs), ('too few outputs to rename', args.rename, 'into', args.outputs)
@@ -326,9 +330,9 @@ def process(fetched_file, file_name, args, remove=True):
if fetched_file_is_dir:
for root, _, files in os.walk(fetched_file):
for filename in files:
- chmod(os.path.join(root, filename), 0o444)
+ make_readonly(os.path.join(root, filename))
else:
- chmod(fetched_file, 0o444)
+ make_readonly(fetched_file)
if args.copy_to:
hardlink_or_copy(fetched_file, args.copy_to)
@@ -367,7 +371,7 @@ def process(fetched_file, file_name, args, remove=True):
# Forbid changes to the loaded resource data
for root, _, files in os.walk(args.untar_to):
for filename in files:
- chmod(os.path.join(root, filename), 0o444)
+ make_readonly(os.path.join(root, filename))
for src, dst in zip(args.rename, args.outputs):
if src == 'RESOURCE':