Bug 6562

Summary: SRC_URI parameter "subdir" does not work for local files
Product: [Build System, Metadata & Runtime] BitBake Reporter: Ross Burton <ross.burton>
Component: bitbakeAssignee: Unassigned <unassigned>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Medium CC: poky.bs.watcher, poky.watcher, tim.jaacks
Version: unspecified   
Target Milestone: 1.7   
Hardware: All   
OS: Multiple   
Whiteboard: Roxanna is no longer at Intel
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

Description Ross Burton 2014-07-21 12:16:42 UTC
With eg SRC_URI=file://foo;subdir=bar, the file gets copied into ${WORKDIR} not ${WORKDIR]/bar.

This is because the destination path is absolute so the chdir to $subdir doesn't have any effect.
Comment 1 Tim Jaacks 2014-07-29 09:37:05 UTC
The according code block is here:

https://github.com/openembedded/bitbake/blob/bfd13dfbc4c9f1dd8315002271791b1d9e274989/lib/bb/fetch2/__init__.py#L1243-L1287

In Line 1281, the cwd is changed to the specified subdir. The copy command is executed in line 1287. However, when the command is constructed in line 1270, the absolute path (rootdir) is added to the relative destdir. Thus, changing the cwd has no effect at all.
Comment 2 Ross Burton 2014-10-27 19:16:54 UTC
Fixed as of bitbake 46306912a96444790efa9418d934dfdd36773ba1