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

Conversation

zhangbo2012
Copy link
Contributor

Mac/Extras.install.py,Can not filter osx DS_store file

As

if name == '.DS_store': return 0

But in OSX, Real File Name is .DS_Store, like this

(venv) zhangbo@zhangbodeMacBook-Pro a2 % ll -a
total 16
drwxr-xr-x  4 zhangbo  staff   128 Oct 22 17:34 .
drwxr-xr-x  8 zhangbo  staff   256 Oct 22 17:18 ..
-rw-r--r--@ 1 zhangbo  staff  6148 Oct 22 17:17 .DS_Store
drwxr-xr-x  3 zhangbo  staff    96 Oct 22 17:23 123

So we need update .DS_store to .DS_Store

@zhangbo2012 zhangbo2012 requested a review from a team as a code owner October 24, 2022 00:38
@bedevere-bot
Copy link

Most changes to Python require a NEWS entry.

Please add it using the blurb_it web app or the blurb command-line tool.

@ghost
Copy link

ghost commented Oct 24, 2022

The following commit authors need to sign the Contributor License Agreement:

Click the button to sign:
CLA not signed

Comment on lines 12 to 16
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
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

@zhangbo2012 zhangbo2012 deleted the B_MAC.Extras.install.py branch October 24, 2022 01:30
@zhangbo2012
Copy link
Contributor Author

Sorry , I use a wrong email, cannot sign Contributor License Agreement @arhadthedev

I'll create a new PR

@arhadthedev
Copy link
Member

For history: the new PR is gh-98580.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants