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
isaak yansane-sisk
slapos.buildout
Commits
7e5bdea9
Commit
7e5bdea9
authored
Oct 07, 2006
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added a recipe update method.
parent
65da05ac
Changes
11
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
197 additions
and
80 deletions
+197
-80
CHANGES.txt
CHANGES.txt
+6
-1
src/zc/buildout/buildout.py
src/zc/buildout/buildout.py
+59
-10
src/zc/buildout/buildout.txt
src/zc/buildout/buildout.txt
+102
-57
src/zc/buildout/tests.py
src/zc/buildout/tests.py
+13
-11
src/zc/buildout/update.txt
src/zc/buildout/update.txt
+1
-0
zc.recipe.egg_/CHANGES.txt
zc.recipe.egg_/CHANGES.txt
+2
-0
zc.recipe.egg_/src/zc/recipe/egg/api.txt
zc.recipe.egg_/src/zc/recipe/egg/api.txt
+3
-0
zc.recipe.egg_/src/zc/recipe/egg/custom.py
zc.recipe.egg_/src/zc/recipe/egg/custom.py
+4
-1
zc.recipe.egg_/src/zc/recipe/egg/egg.py
zc.recipe.egg_/src/zc/recipe/egg/egg.py
+3
-0
zc.recipe.testrunner/CHANGES.txt
zc.recipe.testrunner/CHANGES.txt
+2
-0
zc.recipe.testrunner/src/zc/recipe/testrunner/__init__.py
zc.recipe.testrunner/src/zc/recipe/testrunner/__init__.py
+2
-0
No files found.
CHANGES.txt
View file @
7e5bdea9
...
...
@@ -28,7 +28,12 @@ Next Release
Feature Changes
---------------
Renamed the runsetup command to setup. (The old name still works.)
- Renamed the runsetup command to setup. (The old name still works.)
- Added a recipe update method. Now install is only called when a part
is installed for the first time, or after an uninstall. Otherwise,
update is called. For backward compatibility, recipes that don't
define update methiods are still supported.
1.0.0b9 (2006-10-02)
====================
...
...
src/zc/buildout/buildout.py
View file @
7e5bdea9
...
...
@@ -288,10 +288,21 @@ class Buildout(dict):
for
part
in
reversed
(
installed_parts
):
if
part
in
install_parts
:
old_options
=
installed_part_options
[
part
].
copy
()
old_options
.
pop
(
'__buildout_installed__'
)
installed_files
=
old_options
.
pop
(
'__buildout_installed__'
)
new_options
=
self
.
get
(
part
)
if
old_options
==
new_options
:
continue
# The options are the same, but are all of the
# installed files still there? If not, we should
# reinstall.
if
not
installed_files
:
continue
for
f
in
installed_files
.
split
(
'
\
n
'
):
if
not
os
.
path
.
exists
(
self
.
_buildout_path
(
f
)):
break
else
:
continue
# output debugging info
for
k
in
old_options
:
if
k
not
in
new_options
:
self
.
_logger
.
debug
(
"Part: %s, dropped option %s"
,
...
...
@@ -305,6 +316,7 @@ class Buildout(dict):
if
k
not
in
old_options
:
self
.
_logger
.
debug
(
"Part: %s, new option %s"
,
part
,
k
)
elif
not
uninstall_missing
:
continue
...
...
@@ -316,17 +328,52 @@ class Buildout(dict):
# install new parts
for
part
in
install_parts
:
self
.
_logger
.
info
(
'Installing %s'
,
part
)
installed_part_options
[
part
]
=
self
[
part
].
copy
()
del
self
[
part
][
'__buildout_signature__'
]
installed_files
=
recipes
[
part
].
install
()
or
()
signature
=
self
[
part
].
pop
(
'__buildout_signature__'
)
saved_options
=
self
[
part
].
copy
()
if
part
in
installed_parts
:
self
.
_logger
.
info
(
'Updating %s'
,
part
)
old_options
=
installed_part_options
[
part
]
old_installed_files
=
old_options
[
'__buildout_installed__'
]
try
:
update
=
recipes
[
part
].
update
except
AttributeError
:
update
=
recipes
[
part
].
install
self
.
_logger
.
warning
(
"The recipe for %s doesn't define an update "
"method. Using it's install method"
,
part
)
try
:
installed_files
=
update
()
except
:
installed_parts
.
remove
(
part
)
self
.
_uninstall
(
old_installed_files
)
raise
if
installed_files
is
None
:
installed_files
=
old_installed_files
.
split
(
'
\
n
'
)
else
:
self
.
_logger
.
info
(
'Installing %s'
,
part
)
installed_files
=
recipes
[
part
].
install
()
if
installed_files
is
None
:
self
.
_logger
.
warning
(
"The %s install returned None. A path or "
"iterable os paths should be returned."
,
part
)
installed_files
=
()
if
isinstance
(
installed_files
,
str
):
installed_files
=
[
installed_files
]
installed_part_options
[
part
][
'__buildout_installed__'
]
=
(
'
\
n
'
.
join
(
installed_files
)
)
installed_part_options
[
part
]
=
saved_options
saved_options
[
'__buildout_installed__'
]
=
'
\
n
'
.
join
(
installed_files
)
saved_options
[
'__buildout_signature__'
]
=
signature
if
part
not
in
installed_parts
:
installed_parts
.
append
(
part
)
finally
:
installed_part_options
[
'buildout'
][
'parts'
]
=
' '
.
join
(
[
p
for
p
in
conf_parts
if
p
in
installed_parts
]
...
...
@@ -475,7 +522,9 @@ class Buildout(dict):
return
self
.
_buildout_path
(
self
[
'buildout'
][
'installed'
])
def
_uninstall
(
self
,
installed
):
for
f
in
installed
.
split
():
for
f
in
installed
.
split
(
'
\
n
'
):
if
not
f
:
continue
f
=
self
.
_buildout_path
(
f
)
if
os
.
path
.
isdir
(
f
):
shutil
.
rmtree
(
f
)
...
...
src/zc/buildout/buildout.txt
View file @
7e5bdea9
This diff is collapsed.
Click to expand it.
src/zc/buildout/tests.py
View file @
7e5bdea9
...
...
@@ -178,6 +178,8 @@ def test_comparing_saved_options_with_funny_characters():
... def install(self):
... open('t', 'w').write('t')
... return 't'
...
... update = install
... ''')
...
...
@@ -214,7 +216,7 @@ uninstalling anything because the configuration hasn't changed.
>>> print system(buildout), # doctest: +ELLIPSIS
buildout: Develop: ...setup.py
buildout:
Install
ing debug
buildout:
Updat
ing debug
"""
...
...
@@ -277,22 +279,22 @@ Options:
<BLANKLINE>
-q
<BLANKLINE>
Dec
creaa
e the level of verbosity. This option can be used multiple times.
Dec
reas
e the level of verbosity. This option can be used multiple times.
<BLANKLINE>
-c config_file
<BLANKLINE>
Specify the path to the buildout configuration file to be used.
This defaults to the file named"buildout.cfg" in the current
working directory.
This defaults to the file named
"buildout.cfg" in the current
working directory.
<BLANKLINE>
Assignments are of the form: section:option=value and are used to
provide configuration options that override those give
m
in the
provide configuration options that override those give
n
in the
configuration file. For example, to run the buildout in offline mode,
use buildout:offline=true.
<BLANKLINE>
Options and assignments can be interspersed.
<BLANKLINE>
Comm
mo
nds:
Comm
a
nds:
<BLANKLINE>
install [parts]
<BLANKLINE>
...
...
@@ -324,22 +326,22 @@ Options:
<BLANKLINE>
-q
<BLANKLINE>
Dec
creaa
e the level of verbosity. This option can be used multiple times.
Dec
reas
e the level of verbosity. This option can be used multiple times.
<BLANKLINE>
-c config_file
<BLANKLINE>
Specify the path to the buildout configuration file to be used.
This defaults to the file named"buildout.cfg" in the current
working directory.
This defaults to the file named
"buildout.cfg" in the current
working directory.
<BLANKLINE>
Assignments are of the form: section:option=value and are used to
provide configuration options that override those give
m
in the
provide configuration options that override those give
n
in the
configuration file. For example, to run the buildout in offline mode,
use buildout:offline=true.
<BLANKLINE>
Options and assignments can be interspersed.
<BLANKLINE>
Comm
mo
nds:
Comm
a
nds:
<BLANKLINE>
install [parts]
<BLANKLINE>
...
...
src/zc/buildout/update.txt
View file @
7e5bdea9
...
...
@@ -44,6 +44,7 @@ zc.buildout used:
... for project in 'zc.buildout', 'setuptools':
... req = pkg_resources.Requirement.parse(project)
... print project, pkg_resources.working_set.find(req).version
... return ()
... """)
...
...
zc.recipe.egg_/CHANGES.txt
View file @
7e5bdea9
...
...
@@ -8,6 +8,8 @@ To do
Change History
**************
Updated to work with zc.buildout 1.0.0b10.
1.0.0b1
=======
...
...
zc.recipe.egg_/src/zc/recipe/egg/api.txt
View file @
7e5bdea9
...
...
@@ -38,6 +38,9 @@ around the egg recipe:
... for d in ws:
... print d
... print 'extra paths:', self.egg.extra_paths
... return ()
...
... update = install
... """)
Here we instantiated the egg recipe in the constructor, saving it in
...
...
zc.recipe.egg_/src/zc/recipe/egg/custom.py
View file @
7e5bdea9
...
...
@@ -67,7 +67,7 @@ class Custom:
def
install
(
self
):
if
self
.
buildout
[
'buildout'
].
get
(
'offline'
)
==
'true'
:
return
return
()
options
=
self
.
options
distribution
=
options
.
get
(
'eggs'
,
self
.
name
).
strip
()
build_ext
=
dict
([
...
...
@@ -80,3 +80,6 @@ class Custom:
self
.
links
,
self
.
index
,
options
[
'executable'
],
[
options
[
'_e'
]],
)
return
()
update
=
install
zc.recipe.egg_/src/zc/recipe/egg/egg.py
View file @
7e5bdea9
...
...
@@ -119,3 +119,6 @@ class Egg:
interpreter
=
options
.
get
(
'interpreter'
),
)
return
()
update
=
install
zc.recipe.testrunner/CHANGES.txt
View file @
7e5bdea9
...
...
@@ -2,6 +2,8 @@
Change History
**************
Updated to work with zc.buildout 1.0.0b10.
1.0.0b2
=======
...
...
zc.recipe.testrunner/src/zc/recipe/testrunner/__init__.py
View file @
7e5bdea9
...
...
@@ -54,6 +54,8 @@ class TestRunner:
)),
)
update
=
install
arg_template
=
"""[
'--test-path', %(TESTPATH)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