Fix the computation of basefilename
Change-Id: I156b182414ef5b33611955cbc019e208c771013a
This commit is contained in:
@@ -349,8 +349,9 @@ def CopyPartitionFiles(itemset, input_zip, output_zip=None, substitute=None):
|
|||||||
partition = itemset.partition
|
partition = itemset.partition
|
||||||
|
|
||||||
for info in input_zip.infolist():
|
for info in input_zip.infolist():
|
||||||
if info.filename.startswith(partition.upper() + "/"):
|
prefix = partition.upper() + "/"
|
||||||
basefilename = info.filename[7:]
|
if info.filename.startswith(prefix):
|
||||||
|
basefilename = info.filename[len(prefix):]
|
||||||
if IsSymlink(info):
|
if IsSymlink(info):
|
||||||
symlinks.append((input_zip.read(info.filename),
|
symlinks.append((input_zip.read(info.filename),
|
||||||
"/" + partition + "/" + basefilename))
|
"/" + partition + "/" + basefilename))
|
||||||
@@ -663,7 +664,7 @@ def LoadPartitionFiles(z, partition):
|
|||||||
prefix = partition.upper() + "/"
|
prefix = partition.upper() + "/"
|
||||||
for info in z.infolist():
|
for info in z.infolist():
|
||||||
if info.filename.startswith(prefix) and not IsSymlink(info):
|
if info.filename.startswith(prefix) and not IsSymlink(info):
|
||||||
basefilename = info.filename[7:]
|
basefilename = info.filename[len(prefix):]
|
||||||
fn = partition + "/" + basefilename
|
fn = partition + "/" + basefilename
|
||||||
data = z.read(info.filename)
|
data = z.read(info.filename)
|
||||||
out[fn] = common.File(fn, data)
|
out[fn] = common.File(fn, data)
|
||||||
|
Reference in New Issue
Block a user