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
Nicolas Wavrant
slapos.buildout
Commits
8053d0af
Commit
8053d0af
authored
Jan 27, 2017
by
Nicolas Wavrant
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adds a link verb to buildout allowing to just link to local buildout directories
if the current buildout is already compiled
parent
ca6a2f94
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
0 deletions
+17
-0
src/zc/buildout/buildout.py
src/zc/buildout/buildout.py
+17
-0
No files found.
src/zc/buildout/buildout.py
View file @
8053d0af
...
...
@@ -1799,6 +1799,17 @@ def _open(base, filename, seen, dl_options, override, downloaded):
os
.
remove
(
downloaded_filename
)
options
=
result
.
get
(
'buildout'
,
{})
link
=
options
.
pop
(
'link'
,
""
)
shared_path
=
shared_stack_path
(
link
)
if
link
and
shared_path
:
shared_item_set
=
set
(
os
.
listdir
(
shared_path
))
current_item_set
=
set
(
os
.
listdir
(
'.'
))
for
item
in
shared_item_set
-
current_item_set
:
os
.
symlink
(
os
.
path
.
join
(
shared_path
,
item
),
item
)
Buildout
.
install
=
lambda
*
args
:
None
elif
link
:
options
[
'extends'
]
=
link
extends
=
options
.
pop
(
'extends'
,
None
)
if
'extended-by'
in
options
:
raise
zc
.
buildout
.
UserError
(
...
...
@@ -1833,6 +1844,12 @@ def _open(base, filename, seen, dl_options, override, downloaded):
seen
.
pop
()
return
result
def
shared_stack_path
(
link
):
# md5digest copied from slapos.core. Better to copy/paste more than adding
# dependencies to buildout
link_md5
=
md5
(
link
).
hexdigest
()
shared_stack_path
=
os
.
path
.
join
(
'/'
,
'opt'
,
'slapgrid'
,
link_md5
)
return
(
shared_stack_path
if
os
.
path
.
exists
(
shared_stack_path
)
else
None
)
ignore_directories
=
'.svn'
,
'CVS'
,
'__pycache__'
_dir_hashes
=
{}
...
...
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