Skip to content

Fix: Mac/Extras.install.py,Can not filter osx .DS_store file #98579

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

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Mac/Extras.install.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ def isclean(name):
if name == 'CVS': return 0
if name == '.cvsignore': return 0
if name == '.DS_store': return 0
if name == '.DS_Store': return 0
if name == '.svn': return 0
Comment on lines 12 to 16
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if name == 'CVS': return 0
if name == '.cvsignore': return 0
if name == '.DS_store': return 0
if name == '.DS_Store': return 0
if name == '.svn': return 0
if name in ('CVS', '.cvsignore', '.DS_store', '.DS_Store', '.svn')`:
return 0

A proof-of-concept:

>>> def test(name):
...    return name in ('CVS', '.cvsignore', '.DS_store', '.DS_Store', '.svn')
...
>>> test('fooCVS')
False
>>> test('foo')
False
>>> test('CVS')
True

Copy link
Contributor Author

Choose a reason for hiding this comment

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

simple and better performance

if name.endswith('~'): return 0
if name.endswith('.BAK'): return 0
Expand Down