* fix: use a normal, user temporary directory if writes not allowed in destdir root (which is the normal case for users)

This commit is contained in:
Eray Özkural
2006-04-18 21:32:36 +00:00
parent bb42a67f17
commit ae0b11c7bb
+7 -1
View File
@@ -95,7 +95,13 @@ class Config(object):
return self.subdir(self.values.dirs.index_dir)
def tmp_dir(self):
return self.subdir(self.values.dirs.tmp_dir)
sysdir = self.subdir(self.values.dirs.tmp_dir)
userdir = '/tmp/pisi-' + os.environ['USER'] # FIXME: too unix specific?
# check write access
if os.access(sysdir, os.W_OK):
return sysdir
else:
return userdir
# bu dizini neden kullanıyoruz? Yalnızca index.py içerisinde
# kullanılıyor ama /var/tmp/pisi/install gibi bir dizine niye