diff options
author | Tao Bao <tbao@google.com> | 2015-03-23 16:01:17 -0700 |
---|---|---|
committer | Tao Bao <tbao@google.com> | 2015-03-23 16:05:26 -0700 |
commit | eaf885b1d0f5f841b769b269ce3ac4ed35e6b22d (patch) | |
tree | f7b90cb6c691b6a70a120106034b010cb95eb738 /tools/releasetools/ota_from_target_files | |
parent | 088521ef906346e06ce39c877ff142c2467e3a79 (diff) | |
download | build-eaf885b1d0f5f841b769b269ce3ac4ed35e6b22d.zip build-eaf885b1d0f5f841b769b269ce3ac4ed35e6b22d.tar.gz build-eaf885b1d0f5f841b769b269ce3ac4ed35e6b22d.tar.bz2 |
Fix the computation of basefilename
Change-Id: I156b182414ef5b33611955cbc019e208c771013a
Diffstat (limited to 'tools/releasetools/ota_from_target_files')
-rwxr-xr-x | tools/releasetools/ota_from_target_files | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/tools/releasetools/ota_from_target_files b/tools/releasetools/ota_from_target_files index 6e0fefc..b71baf9 100755 --- a/tools/releasetools/ota_from_target_files +++ b/tools/releasetools/ota_from_target_files @@ -349,8 +349,9 @@ def CopyPartitionFiles(itemset, input_zip, output_zip=None, substitute=None): partition = itemset.partition for info in input_zip.infolist(): - if info.filename.startswith(partition.upper() + "/"): - basefilename = info.filename[7:] + prefix = partition.upper() + "/" + if info.filename.startswith(prefix): + basefilename = info.filename[len(prefix):] if IsSymlink(info): symlinks.append((input_zip.read(info.filename), "/" + partition + "/" + basefilename)) @@ -663,7 +664,7 @@ def LoadPartitionFiles(z, partition): prefix = partition.upper() + "/" for info in z.infolist(): if info.filename.startswith(prefix) and not IsSymlink(info): - basefilename = info.filename[7:] + basefilename = info.filename[len(prefix):] fn = partition + "/" + basefilename data = z.read(info.filename) out[fn] = common.File(fn, data) |