[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [thandy/master] Don't exit when trying to create a directory for an installed package



commit 849bfc07585efc8ca0cc056022af0ef5246b7ad1
Author: Tomás Touceda <chiiph@xxxxxxxxxxxxxx>
Date:   Sat Nov 5 16:55:40 2011 -0300

    Don't exit when trying to create a directory for an installed package
---
 lib/thandy/packagesys/ThpPackages.py |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/lib/thandy/packagesys/ThpPackages.py b/lib/thandy/packagesys/ThpPackages.py
index 4745767..17c0791 100644
--- a/lib/thandy/packagesys/ThpPackages.py
+++ b/lib/thandy/packagesys/ThpPackages.py
@@ -8,6 +8,7 @@ import time
 import shutil
 import subprocess
 import sys
+import errno
 
 from lockfile import LockFile, AlreadyLocked, LockFailed
 
@@ -261,7 +262,11 @@ class ThpInstaller(PS.Installer):
                   pass
 
               if "/" in file["name"]:
-                  os.makedirs("/".join([destPath] + file["name"].split("/")[:-1]))
+                  try:
+                      os.makedirs(os.path.join(*([destPath] + file["name"].split("/")[:-1])))
+                  except OSError, e:
+                      if e.errno != errno.EEXIST:
+                          raise e
 
               shutil.copy(os.path.join(self._pkg.getTmpPath(), "content", file['name']),
                           os.path.join(destPath, file['name']));

_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits