diff options
author | Jürg Billeter <j@bitron.ch> | 2019-02-27 12:55:26 +0100 |
---|---|---|
committer | bst-marge-bot <marge-bot@buildstream.build> | 2019-03-01 05:11:55 +0000 |
commit | f3a63faf7ea88ed95831aa26fe7e9cfa7960d7e3 (patch) | |
tree | 7909066a6023a34be825db63184b52b1a6b1dd17 | |
parent | de6a7591365afab686259bcef14bf3244a918c08 (diff) | |
download | buildstream-f3a63faf7ea88ed95831aa26fe7e9cfa7960d7e3.tar.gz |
_casbaseddirectory.py: Do not sort source directory entries on import
_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.py | 4 |
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) |