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
Jérome Perrin
slapos.buildout
Commits
b77c43ae
Commit
b77c43ae
authored
Jul 10, 2006
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed bug in handling saved option values with a single leading or
trailing newline.
parent
42c0b2ba
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
3 deletions
+31
-3
src/zc/buildout/buildout.py
src/zc/buildout/buildout.py
+22
-3
src/zc/buildout/tests.py
src/zc/buildout/tests.py
+9
-0
No files found.
src/zc/buildout/buildout.py
View file @
b77c43ae
...
...
@@ -242,8 +242,22 @@ class Buildout(dict):
if
part
in
install_parts
:
old_options
=
installed_part_options
[
part
].
copy
()
old_options
.
pop
(
'__buildout_installed__'
)
if
old_options
==
self
.
get
(
part
):
new_options
=
self
.
get
(
part
)
if
old_options
==
new_options
:
continue
for
k
in
old_options
:
if
k
not
in
new_options
:
self
.
_logger
.
debug
(
"Part: %s, dropped option %s"
,
part
,
k
)
elif
old_options
[
k
]
!=
new_options
[
k
]:
self
.
_logger
.
debug
(
"Part: %s, option %s, %r != %r"
,
part
,
k
,
new_options
[
k
],
old_options
[
k
],
)
for
k
in
new_options
:
if
k
not
in
old_options
:
self
.
_logger
.
debug
(
"Part: %s, new option %s"
,
part
,
k
)
elif
not
uninstall_missing
:
continue
...
...
@@ -462,8 +476,9 @@ class Buildout(dict):
_save_options
(
section
,
self
[
section
],
sys
.
stdout
)
print
_spacey_nl
=
re
.
compile
(
'^[
\
t
\
r
\
f
\
v
]+'
'|''[
\
t
\
r
\
f
\
v
]*
\
n
[
\
t
\
r
\
f
\
v
\
n
]*'
_spacey_nl
=
re
.
compile
(
'[
\
t
\
r
\
f
\
v
]*
\
n
[
\
t
\
r
\
f
\
v
\
n
]*'
'|'
'^[
\
t
\
r
\
f
\
v
]+'
'|'
'[
\
t
\
r
\
f
\
v
]+$'
)
...
...
@@ -497,6 +512,10 @@ def _save_options(section, options, f):
for
option
,
value
in
items
:
value
=
value
.
replace
(
'%'
,
'%%'
)
value
=
_spacey_nl
.
sub
(
_quote_spacey_nl
,
value
)
if
value
.
startswith
(
'
\
n
\
t
'
):
value
=
'%(__buildout_space_n__)s'
+
value
[
2
:]
if
value
.
endswith
(
'
\
n
\
t
'
):
value
=
value
[:
-
2
]
+
'%(__buildout_space_n__)s'
print
>>
f
,
option
,
'='
,
value
...
...
src/zc/buildout/tests.py
View file @
b77c43ae
...
...
@@ -80,6 +80,15 @@ def test_comparing_saved_options_with_funny_characters():
...
... </zodb>
...
\
"
\
"
\
"
... options['debug1'] =
\
"
\
"
\
"
... <zodb>
...
... <filestorage>
... path foo
... </filestorage>
...
... </zodb>
...
\
"
\
"
\
"
... options['debug2'] = ' x '
... options['debug3'] = '42'
... options['format'] = '%3d'
...
...
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