diff options
Diffstat (limited to 'libmat2/archive.py')
| -rw-r--r-- | libmat2/archive.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/libmat2/archive.py b/libmat2/archive.py index 2808b9f..7b9f335 100644 --- a/libmat2/archive.py +++ b/libmat2/archive.py | |||
| @@ -74,7 +74,9 @@ class ArchiveBasedAbstractParser(abstract.AbstractParser): | |||
| 74 | temp_folder = tempfile.mkdtemp() | 74 | temp_folder = tempfile.mkdtemp() |
| 75 | abort = False | 75 | abort = False |
| 76 | 76 | ||
| 77 | for item in zin.infolist(): | 77 | # Since files order is a fingerprint factor, |
| 78 | # we're iterating (and thus inserting) them in lexicographic order. | ||
| 79 | for item in sorted(zin.infolist(), key=lambda z: z.filename): | ||
| 78 | if item.filename[-1] == '/': # `is_dir` is added in Python3.6 | 80 | if item.filename[-1] == '/': # `is_dir` is added in Python3.6 |
| 79 | continue # don't keep empty folders | 81 | continue # don't keep empty folders |
| 80 | 82 | ||
| @@ -92,8 +94,7 @@ class ArchiveBasedAbstractParser(abstract.AbstractParser): | |||
| 92 | pass | 94 | pass |
| 93 | elif any(map(lambda r: r.search(item.filename), self.files_to_omit)): | 95 | elif any(map(lambda r: r.search(item.filename), self.files_to_omit)): |
| 94 | continue | 96 | continue |
| 95 | else: | 97 | else: # supported files that we want to first clean, then add |
| 96 | # supported files that we want to clean then add | ||
| 97 | tmp_parser, mtype = parser_factory.get_parser(full_path) # type: ignore | 98 | tmp_parser, mtype = parser_factory.get_parser(full_path) # type: ignore |
| 98 | if not tmp_parser: | 99 | if not tmp_parser: |
| 99 | if self.unknown_member_policy == UnknownMemberPolicy.OMIT: | 100 | if self.unknown_member_policy == UnknownMemberPolicy.OMIT: |
