Commit 7c4c6ee7 authored by Christophe Dumez's avatar Christophe Dumez

- Started removal of system commands (rm, diff..)


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@6574 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 9305b52c
......@@ -48,6 +48,28 @@ try:
except ImportError:
from base64 import encodestring as b64encode, decodestring as b64decode
def removeAll(entry):
'''
Remove all files and directories under 'entry'.
XXX: This is defined here, because os.removedirs() is buggy.
'''
try:
if os.path.isdir(entry) and not os.path.islink(entry):
pwd = os.getcwd()
os.chmod(entry, 0755)
os.chdir(entry)
for e in os.listdir(os.curdir):
removeAll(e)
os.chdir(pwd)
os.rmdir(entry)
else:
if not os.path.islink(entry):
os.chmod(entry, 0644)
os.remove(entry)
except OSError:
pass
class File :
# Constructor
def __init__(self, full_path, msg_status) :
......@@ -665,7 +687,6 @@ class SubversionTool(UniqueObject, Folder):
def extractBT(self, bt):
path = mktemp()
#os.system('rm -rf %s'%path)
bt.export(path=path, local=1)
svn_path = self.getPortalObject().portal_preferences.getPreference('subversion_working_copy')
if not svn_path :
......@@ -680,7 +701,7 @@ class SubversionTool(UniqueObject, Folder):
# add new files and copy
self.addNewFiles(svn_path, path)
# Clean up
os.system('rm -rf %s'%path)
removeAll(path)
# svn del files that have been removed in new dir
def deleteOldFiles(self, old_dir, new_dir):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment