Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.buildout
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
slapos.buildout
Commits
c3903c7e
Commit
c3903c7e
authored
Feb 11, 2022
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixup! download: clean-up, fix, optimization
To be squashed with commit
4ccb79e9
.
parent
09701a6f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
1 deletion
+14
-1
src/zc/buildout/download.py
src/zc/buildout/download.py
+14
-1
No files found.
src/zc/buildout/download.py
View file @
c3903c7e
...
...
@@ -40,7 +40,12 @@ import re
import
shutil
import
tempfile
import
zc.buildout
try
:
from
os.path
import
samefile
except
ImportError
:
samefile
=
lambda
f1
,
f2
:
False
from
.
import
bytes2str
,
str2bytes
from
.rmtree
import
rmtree
class
netrc
(
netrc
.
netrc
):
...
...
@@ -161,7 +166,15 @@ class Download(object):
self
.
logger
.
debug
(
"Fallback to cache using %s"
,
cached_path
,
exception
=
1
)
else
:
locate_at
(
path
,
cached_path
)
# update cache
if
not
samefile
(
path
,
cached_path
):
# update cache
try
:
os
.
remove
(
cached_path
)
except
OSError
as
e
:
if
e
.
errno
!=
errno
.
EISDIR
:
raise
rmtree
(
cached_path
)
locate_at
(
path
,
cached_path
)
return
path
,
is_temp
else
:
self
.
logger
.
debug
(
'Cache miss; will cache %s as %s'
%
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment