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
8
Merge Requests
8
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
fbeee1e3
Commit
fbeee1e3
authored
Feb 22, 2008
by
Andreas Jung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- refactored rmtree functionality
- further rmtree fixes for Windows
parent
10e2f007
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
12 deletions
+10
-12
src/zc/buildout/buildout.py
src/zc/buildout/buildout.py
+4
-2
src/zc/buildout/testing.py
src/zc/buildout/testing.py
+5
-10
src/zc/buildout/tests.py
src/zc/buildout/tests.py
+1
-0
No files found.
src/zc/buildout/buildout.py
View file @
fbeee1e3
...
...
@@ -34,6 +34,8 @@ import pkg_resources
import
zc.buildout
import
zc.buildout.easy_install
from
rmtree
import
rmtree
realpath
=
zc
.
buildout
.
easy_install
.
realpath
pkg_resources_loc
=
pkg_resources
.
working_set
.
find
(
...
...
@@ -570,7 +572,7 @@ class Buildout(UserDict.DictMixin):
continue
f
=
self
.
_buildout_path
(
f
)
if
os
.
path
.
isdir
(
f
):
shutil
.
rmtree
(
f
)
rmtree
(
f
)
elif
os
.
path
.
isfile
(
f
):
os
.
remove
(
f
)
...
...
@@ -992,7 +994,7 @@ class Options(UserDict.DictMixin):
except
:
for
p
in
self
.
_created
:
if
os
.
path
.
isdir
(
p
):
shutil
.
rmtree
(
p
)
rmtree
(
p
)
elif
os
.
path
.
isfile
(
p
):
os
.
remove
(
p
)
else
:
...
...
src/zc/buildout/testing.py
View file @
fbeee1e3
...
...
@@ -26,6 +26,8 @@ import pkg_resources
import
zc.buildout.buildout
import
zc.buildout.easy_install
from
rmtree
import
rmtree
fsync
=
getattr
(
os
,
'fsync'
,
lambda
fileno
:
None
)
setuptools_location
=
pkg_resources
.
working_set
.
find
(
...
...
@@ -87,13 +89,6 @@ def system(command, input=''):
def
get
(
url
):
return
urllib2
.
urlopen
(
url
).
read
()
def
_rmtree
(
path
):
def
retry_writeable
(
func
,
path
,
exc
):
os
.
chmod
(
path
,
0600
)
func
(
path
)
shutil
.
rmtree
(
path
,
onerror
=
retry_writeable
)
def
_runsetup
(
setup
,
executable
,
*
args
):
if
os
.
path
.
isdir
(
setup
):
setup
=
os
.
path
.
join
(
setup
,
'setup.py'
)
...
...
@@ -109,7 +104,7 @@ def _runsetup(setup, executable, *args):
os
.
chdir
(
d
)
os
.
spawnle
(
os
.
P_WAIT
,
executable
,
executable
,
setup
,
*
args
)
if
os
.
path
.
exists
(
'build'
):
_
rmtree
(
'build'
)
rmtree
(
'build'
)
finally
:
os
.
chdir
(
here
)
...
...
@@ -170,7 +165,7 @@ def buildoutSetUp(test):
base
=
tempfile
.
mkdtemp
(
'buildoutSetUp'
)
register_teardown
(
lambda
base
=
base
:
_
rmtree
(
base
))
register_teardown
(
lambda
base
=
base
:
rmtree
(
base
))
old_home
=
os
.
environ
.
get
(
'HOME'
)
os
.
environ
[
'HOME'
]
=
os
.
path
.
join
(
base
,
'bbbBadHome'
)
...
...
@@ -185,7 +180,7 @@ def buildoutSetUp(test):
os
.
mkdir
(
base
)
tmp
=
tempfile
.
mkdtemp
(
'buildouttests'
)
register_teardown
(
lambda
:
_
rmtree
(
tmp
))
register_teardown
(
lambda
:
rmtree
(
tmp
))
zc
.
buildout
.
easy_install
.
default_index_url
=
'file://'
+
tmp
os
.
environ
[
'buildout-testing-index-url'
]
=
(
...
...
src/zc/buildout/tests.py
View file @
fbeee1e3
...
...
@@ -2693,6 +2693,7 @@ def test_suite():
]),
),
zc.buildout.testselectingpython.test_suite(),
zc.buildout.rmtree.test_suite(),
doctest.DocFileSuite(
'windows.txt',
setUp=zc.buildout.testing.buildoutSetUp,
...
...
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