ilk pisi install'unu basariyla yap. bunu denemek icin once
pisi-index'le index dosyasini yapip, sonra bunu pisi-updateindex'le database'e sokup, sonra da pisi-install'la startup... paketini install edebilirsiniz. ayni paketi ikinci kere kurmaya calisinca simdilik yamuluyor. * zip extract code'unu duzelt, artik cikarttirtiyor paketi
This commit is contained in:
+20
-18
@@ -111,42 +111,44 @@ class ArchiveZip(ArchiveBase):
|
|||||||
bool"""
|
bool"""
|
||||||
super(ArchiveZip, self).unpack(targetDir, False)
|
super(ArchiveZip, self).unpack(targetDir, False)
|
||||||
zip = self.zip
|
zip = self.zip
|
||||||
for fileName in zip.namelist():
|
for info in zip.infolist():
|
||||||
if pred(fileName): # check if condition holds
|
if pred(info.filename): # check if condition holds
|
||||||
|
|
||||||
|
# below code removes that, so we find it here
|
||||||
|
isdir = info.filename.endswith('/')
|
||||||
|
|
||||||
# calculate output file name
|
# calculate output file name
|
||||||
if archiveRoot!='':
|
if archiveRoot=='':
|
||||||
|
outpath = info.filename
|
||||||
|
else:
|
||||||
# change archiveRoot
|
# change archiveRoot
|
||||||
if util.subpath(archiveRoot, fileName):
|
if util.subpath(archiveRoot, info.filename):
|
||||||
print '!', archiveRoot, fileName
|
print '!', archiveRoot, info.filename
|
||||||
fileName = util.removepathprefix(archiveRoot, fileName)
|
outpath = util.removepathprefix(archiveRoot,
|
||||||
print '*', fileName
|
info.filename)
|
||||||
|
print '*', outpath
|
||||||
else:
|
else:
|
||||||
|
|
||||||
continue # don't extract if not under
|
continue # don't extract if not under
|
||||||
ofile = os.path.join(targetDir, fileName)
|
|
||||||
|
ofile = os.path.join(targetDir, outpath)
|
||||||
print 'ofile ', ofile
|
print 'ofile ', ofile
|
||||||
|
|
||||||
# a directory is present. lets continue
|
if isdir: # a directory is present.
|
||||||
if fileName.endswith('/'):
|
continue # FIXME: do nothing!
|
||||||
continue
|
|
||||||
|
|
||||||
# check that output dir is present
|
# check that output dir is present
|
||||||
util.check_dir(os.path.dirname(ofile))
|
util.check_dir(os.path.dirname(ofile))
|
||||||
|
|
||||||
info = zip.getinfo(fileName)
|
|
||||||
|
|
||||||
if info.external_attr == self.symmagic:
|
if info.external_attr == self.symmagic:
|
||||||
target = zip.read(fileName)
|
target = zip.read(info.filename)
|
||||||
os.symlink(target, ofile)
|
os.symlink(target, ofile)
|
||||||
else:
|
else:
|
||||||
inf = zip.getinfo(fileName)
|
perm = info.external_attr
|
||||||
perm = inf.external_attr
|
|
||||||
perm &= 0x00FF0000
|
perm &= 0x00FF0000
|
||||||
perm >>= 16
|
perm >>= 16
|
||||||
perm |= 0x00000100
|
perm |= 0x00000100
|
||||||
buff = open (ofile, 'wb')
|
buff = open (ofile, 'wb')
|
||||||
fileContent = zip.read(fileName)
|
fileContent = zip.read(info.filename)
|
||||||
buff.write(fileContent)
|
buff.write(fileContent)
|
||||||
buff.close()
|
buff.close()
|
||||||
os.chmod(ofile, perm)
|
os.chmod(ofile, perm)
|
||||||
|
|||||||
Reference in New Issue
Block a user