diff options
Diffstat (limited to 'meta/lib/oe/sstatesig.py')
-rw-r--r-- | meta/lib/oe/sstatesig.py | 31 |
1 files changed, 13 insertions, 18 deletions
diff --git a/meta/lib/oe/sstatesig.py b/meta/lib/oe/sstatesig.py index 8a97fb0c04..0342bcdc87 100644 --- a/meta/lib/oe/sstatesig.py +++ b/meta/lib/oe/sstatesig.py | |||
@@ -349,7 +349,6 @@ def find_siginfo(pn, taskname, taskhashlist, d): | |||
349 | pn, taskname = key.split(':', 1) | 349 | pn, taskname = key.split(':', 1) |
350 | 350 | ||
351 | hashfiles = {} | 351 | hashfiles = {} |
352 | filedates = {} | ||
353 | 352 | ||
354 | def get_hashval(siginfo): | 353 | def get_hashval(siginfo): |
355 | if siginfo.endswith('.siginfo'): | 354 | if siginfo.endswith('.siginfo'): |
@@ -357,6 +356,12 @@ def find_siginfo(pn, taskname, taskhashlist, d): | |||
357 | else: | 356 | else: |
358 | return siginfo.rpartition('.')[2] | 357 | return siginfo.rpartition('.')[2] |
359 | 358 | ||
359 | def get_time(fullpath): | ||
360 | try: | ||
361 | return os.stat(fullpath).st_mtime | ||
362 | except OSError: | ||
363 | return None | ||
364 | |||
360 | # First search in stamps dir | 365 | # First search in stamps dir |
361 | localdata = d.createCopy() | 366 | localdata = d.createCopy() |
362 | localdata.setVar('MULTIMACH_TARGET_SYS', '*') | 367 | localdata.setVar('MULTIMACH_TARGET_SYS', '*') |
@@ -372,24 +377,21 @@ def find_siginfo(pn, taskname, taskhashlist, d): | |||
372 | filespec = '%s.%s.sigdata.*' % (stamp, taskname) | 377 | filespec = '%s.%s.sigdata.*' % (stamp, taskname) |
373 | foundall = False | 378 | foundall = False |
374 | import glob | 379 | import glob |
380 | bb.debug(1, "Calling glob.glob on {}".format(filespec)) | ||
375 | for fullpath in glob.glob(filespec): | 381 | for fullpath in glob.glob(filespec): |
376 | match = False | 382 | match = False |
377 | if taskhashlist: | 383 | if taskhashlist: |
378 | for taskhash in taskhashlist: | 384 | for taskhash in taskhashlist: |
379 | if fullpath.endswith('.%s' % taskhash): | 385 | if fullpath.endswith('.%s' % taskhash): |
380 | hashfiles[taskhash] = fullpath | 386 | hashfiles[taskhash] = {'path':fullpath, 'sstate':False, 'time':get_time(fullpath)} |
381 | if len(hashfiles) == len(taskhashlist): | 387 | if len(hashfiles) == len(taskhashlist): |
382 | foundall = True | 388 | foundall = True |
383 | break | 389 | break |
384 | else: | 390 | else: |
385 | try: | ||
386 | filedates[fullpath] = os.stat(fullpath).st_mtime | ||
387 | except OSError: | ||
388 | continue | ||
389 | hashval = get_hashval(fullpath) | 391 | hashval = get_hashval(fullpath) |
390 | hashfiles[hashval] = fullpath | 392 | hashfiles[hashval] = {'path':fullpath, 'sstate':False, 'time':get_time(fullpath)} |
391 | 393 | ||
392 | if not taskhashlist or (len(filedates) < 2 and not foundall): | 394 | if not taskhashlist or (len(hashfiles) < 2 and not foundall): |
393 | # That didn't work, look in sstate-cache | 395 | # That didn't work, look in sstate-cache |
394 | hashes = taskhashlist or ['?' * 64] | 396 | hashes = taskhashlist or ['?' * 64] |
395 | localdata = bb.data.createCopy(d) | 397 | localdata = bb.data.createCopy(d) |
@@ -412,22 +414,15 @@ def find_siginfo(pn, taskname, taskhashlist, d): | |||
412 | localdata.setVar('SSTATE_EXTRAPATH', "${NATIVELSBSTRING}/") | 414 | localdata.setVar('SSTATE_EXTRAPATH', "${NATIVELSBSTRING}/") |
413 | filespec = '%s.siginfo' % localdata.getVar('SSTATE_PKG') | 415 | filespec = '%s.siginfo' % localdata.getVar('SSTATE_PKG') |
414 | 416 | ||
417 | bb.debug(1, "Calling glob.glob on {}".format(filespec)) | ||
415 | matchedfiles = glob.glob(filespec) | 418 | matchedfiles = glob.glob(filespec) |
416 | for fullpath in matchedfiles: | 419 | for fullpath in matchedfiles: |
417 | actual_hashval = get_hashval(fullpath) | 420 | actual_hashval = get_hashval(fullpath) |
418 | if actual_hashval in hashfiles: | 421 | if actual_hashval in hashfiles: |
419 | continue | 422 | continue |
420 | hashfiles[hashval] = fullpath | 423 | hashfiles[actual_hashval] = {'path':fullpath, 'sstate':True, 'time':get_time(fullpath)} |
421 | if not taskhashlist: | ||
422 | try: | ||
423 | filedates[fullpath] = os.stat(fullpath).st_mtime | ||
424 | except: | ||
425 | continue | ||
426 | 424 | ||
427 | if taskhashlist: | 425 | return hashfiles |
428 | return hashfiles | ||
429 | else: | ||
430 | return filedates | ||
431 | 426 | ||
432 | bb.siggen.find_siginfo = find_siginfo | 427 | bb.siggen.find_siginfo = find_siginfo |
433 | 428 | ||