Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sort filesystem listings #938

Merged
merged 2 commits into from Feb 11, 2019
Merged

Sort filesystem listings #938

merged 2 commits into from Feb 11, 2019

Conversation

bmwiedemann
Copy link
Contributor

Change proposed in this pull request:

Sort filesystem listings
so that kiwi works in a reproducible way
in spite of indeterministic filesystem readdir order
and http://bugs.python.org/issue30461

See https://reproducible-builds.org/ for why this is good.

Notes:

  • not all sorts might be needed
  • not tested
  • listifies some iterators from iglob, which would have a performance impact if there were thousands of matching entries

@@ -250,7 +250,8 @@ def _create_sortfile(self):
boot_files = list(os.walk(self.source_dir + '/' + self.boot_path))
boot_files += list(os.walk(self.source_dir + '/EFI'))
for basedir, dirnames, filenames in boot_files:
for filename in filenames:
#dirnames.sort() # TODO - seems to break mocking
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

left this for now. One workaround is to write it as dirnames=sorted(dirnames)
but IMHO fixing the tests would be better

Copy link
Collaborator

@schaefi schaefi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks

Just the TODO should be handled, see my comment. Thanks

kiwi/iso_tools/cdrtools.py Outdated Show resolved Hide resolved
@schaefi
Copy link
Collaborator

schaefi commented Feb 11, 2019

I'm fine with the changes and will merge the PR once the conflict got resolved. Thanks

using
tox -v -e unit_py2_7 -- -vv ./test/unit/iso_tools_cdrtools_test.py
so that kiwi works in a reproducible way
in spite of indeterministic filesystem readdir order
and http://bugs.python.org/issue30461

See https://reproducible-builds.org/ for why this is good.
@bmwiedemann
Copy link
Contributor Author

resolved.

Copy link
Collaborator

@davidcassany davidcassany left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me

@schaefi
Copy link
Collaborator

schaefi commented Feb 11, 2019

yes that's nice, thanks 👍

@schaefi schaefi merged commit 5d279c8 into OSInside:master Feb 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants