bitbake: fetch2: uri_replace() only consider ud.localpath where its a file

Using ud.localpath as a basename when it points at a directory causes
problems. The supports_checksum() method gives a good indication of whether
ud.localpath can be used in the way we need.

(From Poky rev: 933ec8a44634e33f92f6f76de3a34094c3d63aa6)

(Bitbake rev: dcd79ae20ab2c72c3312b2251c2b6dc4cabe988e)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Richard Purdie 2012-06-20 12:59:31 +00:00
parent 548465141a
commit a627fe5afe
1 changed files with 1 additions and 1 deletions

View File

@ -217,7 +217,7 @@ def uri_replace(ud, uri_find, uri_replace, d):
basename = os.path.basename(ud.mirrortarball)
# Kill parameters, they make no sense for mirror tarballs
uri_decoded[5] = {}
elif ud.localpath:
elif ud.localpath and ud.method.supports_checksum(ud):
basename = os.path.basename(ud.localpath)
if basename and not result_decoded[loc].endswith(basename):
result_decoded[loc] = os.path.join(result_decoded[loc], basename)