* fix: make decompress work from read-only media
This commit is contained in:
@@ -21,6 +21,7 @@ like all pisi classes, it has been programmed in a non-restricting way
|
|||||||
import os
|
import os
|
||||||
import types
|
import types
|
||||||
import bz2
|
import bz2
|
||||||
|
import shutil
|
||||||
|
|
||||||
import gettext
|
import gettext
|
||||||
__trans = gettext.translation('pisi', fallback=True)
|
__trans = gettext.translation('pisi', fallback=True)
|
||||||
@@ -111,6 +112,10 @@ class File:
|
|||||||
localfile = uri.get_uri() #TODO: use a special function here?
|
localfile = uri.get_uri() #TODO: use a special function here?
|
||||||
if not os.path.exists(localfile):
|
if not os.path.exists(localfile):
|
||||||
raise IOError(_("File \'%s\' not found.") % localfile)
|
raise IOError(_("File \'%s\' not found.") % localfile)
|
||||||
|
if not os.access(localfile, os.W_OK):
|
||||||
|
oldfn = localfile
|
||||||
|
localfile = join(transfer_dir, os.path.basename(localfile))
|
||||||
|
shutil.copy(oldfn, localfile)
|
||||||
|
|
||||||
if sha1sum:
|
if sha1sum:
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user