Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.recipe.build
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
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
slapos.recipe.build
Commits
a2108d20
Commit
a2108d20
authored
Jan 20, 2022
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
default: allow 'install' to install no file/dir
parent
59c48e51
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
49 additions
and
2 deletions
+49
-2
README.rst
README.rst
+43
-0
slapos/recipe/build/__init__.py
slapos/recipe/build/__init__.py
+6
-2
No files found.
README.rst
View file @
a2108d20
...
...
@@ -222,6 +222,49 @@ Setting `location` option is incompatible::
Initializing section script.
Error: When shared=true, option 'location' can't be set
option: location
----------------
If empty or unset, the value is initialized automatically according to rules
defined above (`shared` option), and before the `init` code is executed.
This way, it's possible to initialize other values of the section depending
on the actual value of location.
If not shared, the value can be customized in `init`. This is actually the
only way to empty location, which is useful if there's nothing file/directory
to track but you need to distinguish install from update::
>>> write(sample_buildout, 'buildout.cfg', """
... [buildout]
... parts = script
...
... [script]
... recipe = slapos.recipe.build
... init =
... options['location'] = ''
... install =
... print("install")
... update =
... print("update")
... """)
>>> print(system(buildout))
Uninstalling script.
Installing script.
install
>>> print(system(buildout))
Updating script.
update
>>> cat('.installed.cfg')
[buildout]
...
[script]
__buildout_installed__ =
__buildout_signature__ = ...
If install & update run the same code, `install` can be unset (or empty)
and you can ignore `location`.
=============================
slapos.recipe.build:download
...
...
slapos/recipe/build/__init__.py
View file @
a2108d20
...
...
@@ -263,7 +263,11 @@ class Script(EnvironMixin):
def
install
(
self
):
if
self
.
_install
:
shared
=
self
.
_shared
if
shared
.
location
:
return
self
.
_shared
.
install
(
self
.
__install
)
self
.
_exec
(
self
.
_install
)
else
:
self
.
update
()
return
()
...
...
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