summaryrefslogtreecommitdiffstats
path: root/meta/lib/oe/utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'meta/lib/oe/utils.py')
-rw-r--r--meta/lib/oe/utils.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/meta/lib/oe/utils.py b/meta/lib/oe/utils.py
index a3b1bb1087..14a7d07ef0 100644
--- a/meta/lib/oe/utils.py
+++ b/meta/lib/oe/utils.py
@@ -7,6 +7,7 @@
7import subprocess 7import subprocess
8import multiprocessing 8import multiprocessing
9import traceback 9import traceback
10import errno
10 11
11def read_file(filename): 12def read_file(filename):
12 try: 13 try:
@@ -528,3 +529,14 @@ def directory_size(root, blocksize=4096):
528 total += sum(roundup(getsize(os.path.join(root, name))) for name in files) 529 total += sum(roundup(getsize(os.path.join(root, name))) for name in files)
529 total += roundup(getsize(root)) 530 total += roundup(getsize(root))
530 return total 531 return total
532
533# Update the mtime of a file, skip if permission/read-only issues
534def touch(filename):
535 try:
536 os.utime(filename, None)
537 except PermissionError:
538 pass
539 except OSError as e:
540 # Handle read-only file systems gracefully
541 if e.errno != errno.EROFS:
542 raise e