From: Thomas Leonard Date: Wed, 27 Jun 2012 06:12:32 +0000 (+0100) Subject: Cope with deleting read-only backups X-Git-Tag: v0.14~8 X-Git-Url: https://repo.or.cz/w/0release.git/commitdiff_plain/33cc60c54d4ba82d41579d5f7391029d36e62bb1 Cope with deleting read-only backups --- diff --git a/support.py b/support.py index bb6e4e2..4daea30 100644 --- a/support.py +++ b/support.py @@ -2,10 +2,11 @@ # See the README file for details, or visit http://0install.net. import copy -import os, subprocess, shutil, tarfile +import os, subprocess, tarfile import urlparse, ftplib, httplib from zeroinstall import SafeException from zeroinstall.injector import model, qdom +from zeroinstall.support import ro_rmtree from logging import info release_status_file = os.path.abspath('release-status') @@ -69,7 +70,7 @@ def backup_if_exists(name): if os.path.exists(backup): print "(deleting old backup %s)" % backup if os.path.isdir(backup): - shutil.rmtree(backup) + ro_rmtree(backup) else: os.unlink(backup) os.rename(name, backup)