forked from openkylin/platform_build
allow for malformed imagesizes.txt
Some builds have blank values for max image sizes; ignore these lines.
This commit is contained in:
parent
b615317395
commit
1aca962af1
|
@ -52,8 +52,10 @@ def LoadMaxSizes():
|
||||||
OPTIONS.max_image_size = {}
|
OPTIONS.max_image_size = {}
|
||||||
try:
|
try:
|
||||||
for line in open(os.path.join(OPTIONS.input_tmp, "META", "imagesizes.txt")):
|
for line in open(os.path.join(OPTIONS.input_tmp, "META", "imagesizes.txt")):
|
||||||
image, size = line.split()
|
pieces = line.split()
|
||||||
size = int(size)
|
if len(pieces) != 2: continue
|
||||||
|
image = pieces[0]
|
||||||
|
size = int(pieces[1])
|
||||||
OPTIONS.max_image_size[image + ".img"] = size
|
OPTIONS.max_image_size[image + ".img"] = size
|
||||||
except IOError, e:
|
except IOError, e:
|
||||||
if e.errno == errno.ENOENT:
|
if e.errno == errno.ENOENT:
|
||||||
|
|
Loading…
Reference in New Issue