Bug 6562 - SRC_URI parameter "subdir" does not work for local files
Summary: SRC_URI parameter "subdir" does not work for local files
Status: RESOLVED FIXED
Alias: None
Product: BitBake
Classification: Build System, Metadata & Runtime
Component: bitbake (show other bugs)
Version: unspecified
Hardware: All Multiple
: Medium normal
Target Milestone: 1.7
Assignee: Unassigned
QA Contact:
URL:
Whiteboard: Roxanna is no longer at Intel
Depends on:
Blocks:
 
Reported: 2014-07-21 12:16 UTC by Ross Burton
Modified: 2014-10-27 19:16 UTC (History)
3 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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