Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
mat2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Monitor
Service Desk
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
jvoisin
mat2
Commits
a1a06d02
Commit
a1a06d02
authored
6 years ago
by
Julien (jvoisin) Voisin
Browse files
Options
Downloads
Patches
Plain Diff
Insert archive members in lexicographic order
parent
9275d64b
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
libmat2/archive.py
+4
-3
4 additions, 3 deletions
libmat2/archive.py
with
4 additions
and
3 deletions
libmat2/archive.py
+
4
−
3
View file @
a1a06d02
...
...
@@ -74,7 +74,9 @@ class ArchiveBasedAbstractParser(abstract.AbstractParser):
temp_folder
=
tempfile
.
mkdtemp
()
abort
=
False
for
item
in
zin
.
infolist
():
# Since files order is a fingerprint factor,
# we're iterating (and thus inserting) them in lexicographic order.
for
item
in
sorted
(
zin
.
infolist
(),
key
=
lambda
z
:
z
.
filename
):
if
item
.
filename
[
-
1
]
==
'
/
'
:
# `is_dir` is added in Python3.6
continue
# don't keep empty folders
...
...
@@ -92,8 +94,7 @@ class ArchiveBasedAbstractParser(abstract.AbstractParser):
pass
elif
any
(
map
(
lambda
r
:
r
.
search
(
item
.
filename
),
self
.
files_to_omit
)):
continue
else
:
# supported files that we want to clean then add
else
:
# supported files that we want to first clean, then add
tmp_parser
,
mtype
=
parser_factory
.
get_parser
(
full_path
)
# type: ignore
if
not
tmp_parser
:
if
self
.
unknown_member_policy
==
UnknownMemberPolicy
.
OMIT
:
...
...
This diff is collapsed.
Click to expand it.
jvoisin
@jvoisin
mentioned in issue
#57 (closed)
·
6 years ago
mentioned in issue
#57 (closed)
mentioned in issue #57
Toggle commit list
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment