summaryrefslogtreecommitdiffstats
path: root/meta/classes/sstate.bbclass
diff options
context:
space:
mode:
authorJaewon Lee <jaewon.lee@xilinx.com>2020-02-06 13:45:11 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-02-08 13:19:56 +0000
commit2acfee61a062c6520a413b2a797544d968bb0c76 (patch)
tree826413ed3a0f5fa2167f2dbace56c7e784c2ed27 /meta/classes/sstate.bbclass
parent17fa66c8199d73f0b59b2b3e609075933bf1e74b (diff)
downloadopenembedded-core-2acfee61a062c6520a413b2a797544d968bb0c76.tar.gz
sstate.bbclass: fix issue while handling long sstate filenames
When moving to python3, divison using '/' now returns float instead of an integer. In upstream commit b8025e972081b70960ffcbcbe43a7118041556a1 sstate filenames longer than the limit are changed to just include necessary info + 3 fields just for information. The space left over after the necessary info is divided into 3 for each of the fields. Using '//' instead to do the division to solve the following error message: avail = (254 - len(hash + "_" + taskname + extension) - len(components[0]) - len(components[1]) - len(components[5]) - len(components[6]) - 7) / 3 > components[2] = components[2][:avail] components[3] = components[3][:avail] TypeError: slice indices must be integers or None or have an __index__ method Signed-off-by: Jaewon Lee <jaewon.lee@xilinx.com> Signed-off-by: Mark Hatle <mark.hatle@xilinx.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/sstate.bbclass')
-rw-r--r--meta/classes/sstate.bbclass2
1 files changed, 1 insertions, 1 deletions
diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass
index faa6470450..0beeb33707 100644
--- a/meta/classes/sstate.bbclass
+++ b/meta/classes/sstate.bbclass
@@ -20,7 +20,7 @@ def generate_sstatefn(spec, hash, taskname, siginfo, d):
components = spec.split(":")
# Fields 0,5,6 are mandatory, 1 is most useful, 2,3,4 are just for information
# 7 is for the separators
- avail = (254 - len(hash + "_" + taskname + extension) - len(components[0]) - len(components[1]) - len(components[5]) - len(components[6]) - 7) / 3
+ avail = (254 - len(hash + "_" + taskname + extension) - len(components[0]) - len(components[1]) - len(components[5]) - len(components[6]) - 7) // 3
components[2] = components[2][:avail]
components[3] = components[3][:avail]
components[4] = components[4][:avail]