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
Rafael Monnerat
slapos.buildout
Commits
d0ec374e
Commit
d0ec374e
authored
Feb 04, 2016
by
Kazuhiko Shiozaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Factorise _compute_part_hash().
parent
f210c1d2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
+7
-4
src/zc/buildout/buildout.py
src/zc/buildout/buildout.py
+7
-4
No files found.
src/zc/buildout/buildout.py
View file @
d0ec374e
...
@@ -928,6 +928,12 @@ class Buildout(DictMixin):
...
@@ -928,6 +928,12 @@ class Buildout(DictMixin):
self
.
_logger
.
warning
(
self
.
_logger
.
warning
(
"Unexpected entry, %r, in develop-eggs directory."
,
f
)
"Unexpected entry, %r, in develop-eggs directory."
,
f
)
def
_compute_part_hash
(
self
,
part
):
m
=
md5
()
for
k
,
v
in
sorted
(
self
.
get
(
part
).
items
()):
m
.
update
((
'%r: %r'
%
(
k
,
v
)).
encode
())
return
m
.
hexdigest
()
def
_compute_part_signatures
(
self
,
parts
):
def
_compute_part_signatures
(
self
,
parts
):
# Compute recipe signature and add to options
# Compute recipe signature and add to options
for
part
in
parts
:
for
part
in
parts
:
...
@@ -938,10 +944,7 @@ class Buildout(DictMixin):
...
@@ -938,10 +944,7 @@ class Buildout(DictMixin):
req
=
pkg_resources
.
Requirement
.
parse
(
recipe
)
req
=
pkg_resources
.
Requirement
.
parse
(
recipe
)
sig
=
sorted
(
set
(
_dists_sig
(
pkg_resources
.
working_set
.
resolve
([
req
]))))
sig
=
sorted
(
set
(
_dists_sig
(
pkg_resources
.
working_set
.
resolve
([
req
]))))
for
dependency
in
sorted
(
getattr
(
options
,
'_dependency'
,
[])):
for
dependency
in
sorted
(
getattr
(
options
,
'_dependency'
,
[])):
m
=
md5
()
dependency_hash
=
self
.
_compute_part_hash
(
dependency
)
for
k
,
v
in
sorted
(
self
.
get
(
dependency
).
items
()):
m
.
update
((
'%r: %r'
%
(
k
,
v
)).
encode
())
dependency_hash
=
m
.
hexdigest
()
sig
.
append
(
'%s:%s'
%
(
dependency
,
dependency_hash
))
sig
.
append
(
'%s:%s'
%
(
dependency
,
dependency_hash
))
options
[
'__buildout_signature__'
]
=
' '
.
join
(
sig
)
options
[
'__buildout_signature__'
]
=
' '
.
join
(
sig
)
...
...
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