summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJürg Billeter <j@bitron.ch>2019-02-27 12:55:26 +0100
committerJürg Billeter <j@bitron.ch>2019-02-28 14:05:47 +0100
commit3c7c2d5896e072cf77d0eb299ce6bc5897b55f81 (patch)
treeb834cb77f51150fc46eed959cc6a67ccb8e172be
parentd5be8c3e8013c7af01cdeab66bd7981db0f641b6 (diff)
downloadbuildstream-juerg/lazy-directory-digest.tar.gz
_casbaseddirectory.py: Do not sort source directory entries on importjuerg/lazy-directory-digest
_get_digest() now ensures that the created Directory protos are in canonical form. This eliminates the need to sort source directory entries in import_files().
-rw-r--r--buildstream/storage/_casbaseddirectory.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/buildstream/storage/_casbaseddirectory.py b/buildstream/storage/_casbaseddirectory.py
index 37bf5693c..43497eaf7 100644
--- a/buildstream/storage/_casbaseddirectory.py
+++ b/buildstream/storage/_casbaseddirectory.py
@@ -256,7 +256,7 @@ class CasBasedDirectory(Directory):
def _import_files_from_directory(self, source_directory, filter_callback, *, path_prefix="", result):
""" Import files from a traditional directory. """
- for direntry in sorted(os.scandir(source_directory), key=lambda e: e.name):
+ for direntry in os.scandir(source_directory):
# The destination filename, relative to the root where the import started
relative_pathname = os.path.join(path_prefix, direntry.name)
@@ -296,7 +296,7 @@ class CasBasedDirectory(Directory):
def _partial_import_cas_into_cas(self, source_directory, filter_callback, *, path_prefix="", result):
""" Import files from a CAS-based directory. """
- for name, entry in sorted(source_directory.index.items()):
+ for name, entry in source_directory.index.items():
# The destination filename, relative to the root where the import started
relative_pathname = os.path.join(path_prefix, name)