Skip to content

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

Closed
zhangbo2012 wants to merge 1 commit into
python:mainfrom
zhangbo2012:B_MAC.Extras.install.py
Closed

Fix: Mac/Extras.install.py,Can not filter osx .DS_store file#98579
zhangbo2012 wants to merge 1 commit into
python:mainfrom
zhangbo2012:B_MAC.Extras.install.py

Conversation

@zhangbo2012

Copy link
Copy Markdown
Contributor

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

As

ifname=='.DS_store': return0

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

@bedevere-bot

Copy link
Copy Markdown

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
Copy Markdown

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

Click the button to sign:
CLA not signed

Comment threadMac/Extras.install.py
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
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
ifname=='CVS': return0
ifname=='.cvsignore': return0
ifname=='.DS_store': return0
ifname=='.DS_Store': return0
ifname=='.svn': return0
ifnamein ('CVS', '.cvsignore', '.DS_store', '.DS_Store', '.svn')`:
return0

A proof-of-concept:

>>>deftest(name):
... returnnamein ('CVS', '.cvsignore', '.DS_store', '.DS_Store', '.svn')
...
>>>test('fooCVS')
False>>>test('foo')
False>>>test('CVS')
True

Copy link
Copy Markdown
ContributorAuthor

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
Copy Markdown
ContributorAuthor

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

I'll create a new PR

@arhadthedev

Copy link
Copy Markdown
Member

For history: the new PR is gh-98580.

Sign up for freeto 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

@zhangbo2012@bedevere-bot@arhadthedev