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
6
Merge Requests
6
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
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
Show 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
...
@@ -28,7 +28,12 @@ Next Release
Feature Changes
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)
1.0.0b9 (2006-10-02)
====================
====================
...
...
src/zc/buildout/buildout.py
View file @
7e5bdea9
...
@@ -288,10 +288,21 @@ class Buildout(dict):
...
@@ -288,10 +288,21 @@ class Buildout(dict):
for
part
in
reversed
(
installed_parts
):
for
part
in
reversed
(
installed_parts
):
if
part
in
install_parts
:
if
part
in
install_parts
:
old_options
=
installed_part_options
[
part
].
copy
()
old_options
=
installed_part_options
[
part
].
copy
()
old_options
.
pop
(
'__buildout_installed__'
)
installed_files
=
old_options
.
pop
(
'__buildout_installed__'
)
new_options
=
self
.
get
(
part
)
new_options
=
self
.
get
(
part
)
if
old_options
==
new_options
:
if
old_options
==
new_options
:
# The options are the same, but are all of the
# installed files still there? If not, we should
# reinstall.
if
not
installed_files
:
continue
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
:
for
k
in
old_options
:
if
k
not
in
new_options
:
if
k
not
in
new_options
:
self
.
_logger
.
debug
(
"Part: %s, dropped option %s"
,
self
.
_logger
.
debug
(
"Part: %s, dropped option %s"
,
...
@@ -305,6 +316,7 @@ class Buildout(dict):
...
@@ -305,6 +316,7 @@ class Buildout(dict):
if
k
not
in
old_options
:
if
k
not
in
old_options
:
self
.
_logger
.
debug
(
"Part: %s, new option %s"
,
self
.
_logger
.
debug
(
"Part: %s, new option %s"
,
part
,
k
)
part
,
k
)
elif
not
uninstall_missing
:
elif
not
uninstall_missing
:
continue
continue
...
@@ -316,17 +328,52 @@ class Buildout(dict):
...
@@ -316,17 +328,52 @@ class Buildout(dict):
# install new parts
# install new parts
for
part
in
install_parts
:
for
part
in
install_parts
:
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
)
self
.
_logger
.
info
(
'Installing %s'
,
part
)
installed_part_options
[
part
]
=
self
[
part
].
copy
()
installed_files
=
recipes
[
part
].
install
()
del
self
[
part
][
'__buildout_signature__'
]
if
installed_files
is
None
:
installed_files
=
recipes
[
part
].
install
()
or
()
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
):
if
isinstance
(
installed_files
,
str
):
installed_files
=
[
installed_files
]
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
:
if
part
not
in
installed_parts
:
installed_parts
.
append
(
part
)
installed_parts
.
append
(
part
)
finally
:
finally
:
installed_part_options
[
'buildout'
][
'parts'
]
=
' '
.
join
(
installed_part_options
[
'buildout'
][
'parts'
]
=
' '
.
join
(
[
p
for
p
in
conf_parts
if
p
in
installed_parts
]
[
p
for
p
in
conf_parts
if
p
in
installed_parts
]
...
@@ -475,7 +522,9 @@ class Buildout(dict):
...
@@ -475,7 +522,9 @@ class Buildout(dict):
return
self
.
_buildout_path
(
self
[
'buildout'
][
'installed'
])
return
self
.
_buildout_path
(
self
[
'buildout'
][
'installed'
])
def
_uninstall
(
self
,
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
)
f
=
self
.
_buildout_path
(
f
)
if
os
.
path
.
isdir
(
f
):
if
os
.
path
.
isdir
(
f
):
shutil
.
rmtree
(
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():
...
@@ -178,6 +178,8 @@ def test_comparing_saved_options_with_funny_characters():
... def install(self):
... def install(self):
... open('t', 'w').write('t')
... open('t', 'w').write('t')
... return 't'
... return 't'
...
... update = install
... ''')
... ''')
...
@@ -214,7 +216,7 @@ uninstalling anything because the configuration hasn't changed.
...
@@ -214,7 +216,7 @@ uninstalling anything because the configuration hasn't changed.
>>> print system(buildout), # doctest: +ELLIPSIS
>>> print system(buildout), # doctest: +ELLIPSIS
buildout: Develop: ...setup.py
buildout: Develop: ...setup.py
buildout:
Install
ing debug
buildout:
Updat
ing debug
"""
"""
...
@@ -277,22 +279,22 @@ Options:
...
@@ -277,22 +279,22 @@ Options:
<BLANKLINE>
<BLANKLINE>
-q
-q
<BLANKLINE>
<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>
<BLANKLINE>
-c config_file
-c config_file
<BLANKLINE>
<BLANKLINE>
Specify the path to the buildout configuration file to be used.
Specify the path to the buildout configuration file to be used.
This defaults to the file named"buildout.cfg" in the current
This defaults to the file named
"buildout.cfg" in the current
working directory.
working directory.
<BLANKLINE>
<BLANKLINE>
Assignments are of the form: section:option=value and are used to
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,
configuration file. For example, to run the buildout in offline mode,
use buildout:offline=true.
use buildout:offline=true.
<BLANKLINE>
<BLANKLINE>
Options and assignments can be interspersed.
Options and assignments can be interspersed.
<BLANKLINE>
<BLANKLINE>
Comm
mo
nds:
Comm
a
nds:
<BLANKLINE>
<BLANKLINE>
install [parts]
install [parts]
<BLANKLINE>
<BLANKLINE>
...
@@ -324,22 +326,22 @@ Options:
...
@@ -324,22 +326,22 @@ Options:
<BLANKLINE>
<BLANKLINE>
-q
-q
<BLANKLINE>
<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>
<BLANKLINE>
-c config_file
-c config_file
<BLANKLINE>
<BLANKLINE>
Specify the path to the buildout configuration file to be used.
Specify the path to the buildout configuration file to be used.
This defaults to the file named"buildout.cfg" in the current
This defaults to the file named
"buildout.cfg" in the current
working directory.
working directory.
<BLANKLINE>
<BLANKLINE>
Assignments are of the form: section:option=value and are used to
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,
configuration file. For example, to run the buildout in offline mode,
use buildout:offline=true.
use buildout:offline=true.
<BLANKLINE>
<BLANKLINE>
Options and assignments can be interspersed.
Options and assignments can be interspersed.
<BLANKLINE>
<BLANKLINE>
Comm
mo
nds:
Comm
a
nds:
<BLANKLINE>
<BLANKLINE>
install [parts]
install [parts]
<BLANKLINE>
<BLANKLINE>
...
...
src/zc/buildout/update.txt
View file @
7e5bdea9
...
@@ -44,6 +44,7 @@ zc.buildout used:
...
@@ -44,6 +44,7 @@ zc.buildout used:
... for project in 'zc.buildout', 'setuptools':
... for project in 'zc.buildout', 'setuptools':
... req = pkg_resources.Requirement.parse(project)
... req = pkg_resources.Requirement.parse(project)
... print project, pkg_resources.working_set.find(req).version
... print project, pkg_resources.working_set.find(req).version
... return ()
... """)
... """)
...
...
zc.recipe.egg_/CHANGES.txt
View file @
7e5bdea9
...
@@ -8,6 +8,8 @@ To do
...
@@ -8,6 +8,8 @@ To do
Change History
Change History
**************
**************
Updated to work with zc.buildout 1.0.0b10.
1.0.0b1
1.0.0b1
=======
=======
...
...
zc.recipe.egg_/src/zc/recipe/egg/api.txt
View file @
7e5bdea9
...
@@ -38,6 +38,9 @@ around the egg recipe:
...
@@ -38,6 +38,9 @@ around the egg recipe:
... for d in ws:
... for d in ws:
... print d
... print d
... print 'extra paths:', self.egg.extra_paths
... print 'extra paths:', self.egg.extra_paths
... return ()
...
... update = install
... """)
... """)
Here we instantiated the egg recipe in the constructor, saving it in
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:
...
@@ -67,7 +67,7 @@ class Custom:
def
install
(
self
):
def
install
(
self
):
if
self
.
buildout
[
'buildout'
].
get
(
'offline'
)
==
'true'
:
if
self
.
buildout
[
'buildout'
].
get
(
'offline'
)
==
'true'
:
return
return
()
options
=
self
.
options
options
=
self
.
options
distribution
=
options
.
get
(
'eggs'
,
self
.
name
).
strip
()
distribution
=
options
.
get
(
'eggs'
,
self
.
name
).
strip
()
build_ext
=
dict
([
build_ext
=
dict
([
...
@@ -80,3 +80,6 @@ class Custom:
...
@@ -80,3 +80,6 @@ class Custom:
self
.
links
,
self
.
index
,
options
[
'executable'
],
[
options
[
'_e'
]],
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:
...
@@ -119,3 +119,6 @@ class Egg:
interpreter
=
options
.
get
(
'interpreter'
),
interpreter
=
options
.
get
(
'interpreter'
),
)
)
return
()
update
=
install
zc.recipe.testrunner/CHANGES.txt
View file @
7e5bdea9
...
@@ -2,6 +2,8 @@
...
@@ -2,6 +2,8 @@
Change History
Change History
**************
**************
Updated to work with zc.buildout 1.0.0b10.
1.0.0b2
1.0.0b2
=======
=======
...
...
zc.recipe.testrunner/src/zc/recipe/testrunner/__init__.py
View file @
7e5bdea9
...
@@ -54,6 +54,8 @@ class TestRunner:
...
@@ -54,6 +54,8 @@ class TestRunner:
)),
)),
)
)
update
=
install
arg_template
=
"""[
arg_template
=
"""[
'--test-path', %(TESTPATH)s,
'--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