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
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Thomas Leymonerie
slapos.recipe.build
Commits
759e932a
Commit
759e932a
authored
Oct 07, 2014
by
Cédric de Saint Martin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gitclone: empty parameter equals no parameter.
It allows to easily extend an existing section
parent
1847206c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
5 deletions
+42
-5
README.rst
README.rst
+33
-0
slapos/recipe/gitclone.py
slapos/recipe/gitclone.py
+9
-5
No files found.
README.rst
View file @
759e932a
...
...
@@ -188,6 +188,39 @@ When updating, it will do a "git fetch; git reset revision"::
Updating git-clone.
Fetching origin
HEAD is now at ...
Empty revision/branch
---------------------
Specifying an empty revision or an empty branch will make buildout
ignore those values as if it was not present at all (allowing to easily
extend an existing section specifying a branch)::
>>> cd(sample_buildout)
>>> write(sample_buildout, 'buildout.cfg',
... """
... [buildout]
... parts = git-clone
...
... [git-clone-with-branch]
... recipe = slapos.recipe.build:gitclone
... repository = http://git.erp5.org/repos/slapos.recipe.build.git
... revision = 2566127
...
... [git-clone]
... <= git-clone-with-branch
... revision =
... branch = master
... """)
>>> print system(buildout)
Uninstalling git-clone.
Running uninstall recipe.
Installing git-clone.
Cloning into '/sample-buildout/parts/git-clone'...
>>> cd(sample_buildout, 'parts', 'git-clone')
>>> print system('git branch')
* master
Specific git binary
-------------------
...
...
slapos/recipe/gitclone.py
View file @
759e932a
...
...
@@ -126,12 +126,16 @@ class Recipe(object):
def
__init__
(
self
,
buildout
,
name
,
options
):
options
.
setdefault
(
'location'
,
os
.
path
.
join
(
buildout
[
'buildout'
][
'parts-directory'
],
name
))
self
.
repository
=
options
.
get
(
'repository'
)
self
.
branch
=
options
.
get
(
'branch'
)
self
.
revision
=
options
.
get
(
'revision'
)
self
.
git_command
=
options
.
get
(
'git-executable'
,
'git'
)
self
.
name
=
name
self
.
location
=
options
.
get
(
'location'
)
for
option
in
(
'branch'
,
'revision'
,
'location'
,
'repository'
):
value
=
options
.
get
(
option
,
''
).
strip
()
if
value
==
''
:
setattr
(
self
,
option
,
None
)
else
:
setattr
(
self
,
option
,
value
)
self
.
git_command
=
options
.
get
(
'git-executable'
,
''
)
if
self
.
git_command
==
''
:
self
.
git_command
=
'git'
# Set boolean values
for
key
in
(
'develop'
,
'use-cache'
,
'ignore-ssl-certificate'
):
setattr
(
self
,
key
.
replace
(
'-'
,
'_'
),
options
.
get
(
key
)
in
TRUE_VALUES
)
...
...
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