diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-03-23 14:48:08 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-03-24 17:45:28 +0000 |
commit | 09e826cfb021731c1b139046665d2d9fa24baa88 (patch) | |
tree | 1d6bb6b639052f5d098d3451698892cf36a01ba2 /bitbake/lib/bb/utils.py | |
parent | e0a812b2fea76b785de345893901676f1b9683cf (diff) | |
download | poky-09e826cfb021731c1b139046665d2d9fa24baa88.tar.gz |
bitbake: utils: Fix lockfile path length issues
If the path to bitbake.lock is in a deep directory, bitbake will hang. The
reason was that the max file length limiting code (to 255 chars) was including
the directory name and it should only act on the filename within the directory.
Fix it to just use the base filename.
[YOCTO #14766]
(Bitbake rev: 89d70e7b71eecfe06592202f326e566c579ba01d)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/utils.py')
-rw-r--r-- | bitbake/lib/bb/utils.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/bitbake/lib/bb/utils.py b/bitbake/lib/bb/utils.py index fcaeb99162..d11da978d7 100644 --- a/bitbake/lib/bb/utils.py +++ b/bitbake/lib/bb/utils.py | |||
@@ -453,13 +453,16 @@ def lockfile(name, shared=False, retry=True, block=False): | |||
453 | consider the possibility of sending a signal to the process to break | 453 | consider the possibility of sending a signal to the process to break |
454 | out - at which point you want block=True rather than retry=True. | 454 | out - at which point you want block=True rather than retry=True. |
455 | """ | 455 | """ |
456 | if len(name) > 255: | 456 | basename = os.path.basename(name) |
457 | root, ext = os.path.splitext(name) | 457 | if len(basename) > 255: |
458 | name = root[:255 - len(ext)] + ext | 458 | root, ext = os.path.splitext(basename) |
459 | basename = root[:255 - len(ext)] + ext | ||
459 | 460 | ||
460 | dirname = os.path.dirname(name) | 461 | dirname = os.path.dirname(name) |
461 | mkdirhier(dirname) | 462 | mkdirhier(dirname) |
462 | 463 | ||
464 | name = os.path.join(dirname, basename) | ||
465 | |||
463 | if not os.access(dirname, os.W_OK): | 466 | if not os.access(dirname, os.W_OK): |
464 | logger.error("Unable to acquire lock '%s', directory is not writable", | 467 | logger.error("Unable to acquire lock '%s', directory is not writable", |
465 | name) | 468 | name) |