Merged Python-2.6 patch
This commit is contained in:
@@ -1,3 +1,6 @@
|
|||||||
|
2009-02-13 Bahadır Kandemir <bahadir@pardus.org.tr>
|
||||||
|
* Merged Python 2.6 patch
|
||||||
|
|
||||||
2009-02-13 Faik Uygur <faik@pardus.org.tr>
|
2009-02-13 Faik Uygur <faik@pardus.org.tr>
|
||||||
* pisi-2.1.2
|
* pisi-2.1.2
|
||||||
|
|
||||||
|
|||||||
+9
-2
@@ -20,6 +20,8 @@ import tarfile
|
|||||||
import zipfile
|
import zipfile
|
||||||
import gzip
|
import gzip
|
||||||
import struct
|
import struct
|
||||||
|
import sys
|
||||||
|
import distutils.version
|
||||||
|
|
||||||
import gettext
|
import gettext
|
||||||
__trans = gettext.translation('pisi', fallback=True)
|
__trans = gettext.translation('pisi', fallback=True)
|
||||||
@@ -187,7 +189,7 @@ class ArchiveTar(ArchiveBase):
|
|||||||
def close(self):
|
def close(self):
|
||||||
self.tar.close()
|
self.tar.close()
|
||||||
|
|
||||||
if self.tar.mode == 'wb' and self.type == 'tarlzma':
|
if 'w' in str(self.tar.mode) and self.type == 'tarlzma':
|
||||||
batch = None
|
batch = None
|
||||||
if ctx.config.values.build.compressionlevel:
|
if ctx.config.values.build.compressionlevel:
|
||||||
batch = "lzma -%s -z %s" % (ctx.config.values.build.compressionlevel, self.file_path)
|
batch = "lzma -%s -z %s" % (ctx.config.values.build.compressionlevel, self.file_path)
|
||||||
@@ -414,7 +416,12 @@ class ArchiveZip(ArchiveBase):
|
|||||||
perm &= 0x08FF0000
|
perm &= 0x08FF0000
|
||||||
perm >>= 16
|
perm >>= 16
|
||||||
perm |= 0x00000100
|
perm |= 0x00000100
|
||||||
zip_obj.decompressToFile(info.filename, ofile)
|
|
||||||
|
version = sys.version.split()[0]
|
||||||
|
if distutils.version.StrictVersion(version) < distutils.version.StrictVersion("2.6.0"):
|
||||||
|
zip_obj.decompressToFile(info.filename, ofile)
|
||||||
|
else:
|
||||||
|
zip_obj.extract(info.filename, target_dir)
|
||||||
os.chmod(ofile, perm)
|
os.chmod(ofile, perm)
|
||||||
|
|
||||||
def unpack_files(self, paths, target_dir):
|
def unpack_files(self, paths, target_dir):
|
||||||
|
|||||||
@@ -1,36 +0,0 @@
|
|||||||
Index: pisi/archive.py
|
|
||||||
===================================================================
|
|
||||||
--- pisi/archive.py (revision 21417)
|
|
||||||
+++ pisi/archive.py (working copy)
|
|
||||||
@@ -20,6 +20,8 @@
|
|
||||||
import zipfile
|
|
||||||
import gzip
|
|
||||||
import struct
|
|
||||||
+import sys
|
|
||||||
+import distutils.version
|
|
||||||
|
|
||||||
import gettext
|
|
||||||
__trans = gettext.translation('pisi', fallback=True)
|
|
||||||
@@ -187,7 +189,7 @@
|
|
||||||
def close(self):
|
|
||||||
self.tar.close()
|
|
||||||
|
|
||||||
- if self.tar.mode == 'wb' and self.type == 'tarlzma':
|
|
||||||
+ if 'w' in str(self.tar.mode) and self.type == 'tarlzma':
|
|
||||||
batch = None
|
|
||||||
if ctx.config.values.build.compressionlevel:
|
|
||||||
batch = "lzma -%s -z %s" % (ctx.config.values.build.compressionlevel, self.file_path)
|
|
||||||
@@ -414,7 +416,12 @@
|
|
||||||
perm &= 0x08FF0000
|
|
||||||
perm >>= 16
|
|
||||||
perm |= 0x00000100
|
|
||||||
- zip_obj.decompressToFile(info.filename, ofile)
|
|
||||||
+
|
|
||||||
+ version = sys.version.split()[0]
|
|
||||||
+ if distutils.version.StrictVersion(version) < distutils.version.StrictVersion("2.6.0"):
|
|
||||||
+ zip_obj.decompressToFile(info.filename, ofile)
|
|
||||||
+ else:
|
|
||||||
+ zip_obj.extract(info.filename, target_dir)
|
|
||||||
os.chmod(ofile, perm)
|
|
||||||
|
|
||||||
def unpack_files(self, paths, target_dir):
|
|
||||||
Reference in New Issue
Block a user