diff options
author | Petter Mabäcker <petter@technux.se> | 2015-01-04 23:45:46 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-01-23 11:36:28 +0000 |
commit | cf72ede74d35746a10d0708942287548f9c72f30 (patch) | |
tree | 75cc16ad40b6de07a892bda4cc190996aaab75b0 /meta/classes/base.bbclass | |
parent | 4eb3db9a2ca8eaff64b64b8f56dac25d4734571c (diff) | |
download | poky-cf72ede74d35746a10d0708942287548f9c72f30.tar.gz |
base.bbclass: detect when S has been set incorrectly
Currently base.bbclass is creating S if it's not created by unpacking
an archive or fetching a repository. If we avoid creating S we can detect
when S hasn't been set correctly, since it will not exist. Then we can tell
the user that they should set S to a proper value, instead of just failing
with odd errors in later tasks.
Besides removing the auto-creation of S this change will introduce a warning
if S is set incorrectly. The reason for not display an error and return
is due to all external layers that might have recipes that will fail otherwise
and that might be a bit to hard to start with. So use a warning until people
have had a chance to cleanup affected recipes.
[YOCTO #5627]
(From OE-Core rev: 0d84b9a8ba408d168cb8a92e895d2f7338d6da1b)
Signed-off-by: Petter Mabäcker <petter@technux.se>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/base.bbclass')
-rw-r--r-- | meta/classes/base.bbclass | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass index de50be1d5b..789af3b10b 100644 --- a/meta/classes/base.bbclass +++ b/meta/classes/base.bbclass | |||
@@ -113,7 +113,6 @@ python base_do_fetch() { | |||
113 | 113 | ||
114 | addtask unpack after do_fetch | 114 | addtask unpack after do_fetch |
115 | do_unpack[dirs] = "${WORKDIR}" | 115 | do_unpack[dirs] = "${WORKDIR}" |
116 | do_unpack[cleandirs] = "${S}/patches" | ||
117 | python base_do_unpack() { | 116 | python base_do_unpack() { |
118 | src_uri = (d.getVar('SRC_URI', True) or "").split() | 117 | src_uri = (d.getVar('SRC_URI', True) or "").split() |
119 | if len(src_uri) == 0: | 118 | if len(src_uri) == 0: |
@@ -121,11 +120,21 @@ python base_do_unpack() { | |||
121 | 120 | ||
122 | rootdir = d.getVar('WORKDIR', True) | 121 | rootdir = d.getVar('WORKDIR', True) |
123 | 122 | ||
123 | # Ensure that we cleanup ${S}/patches | ||
124 | # TODO: Investigate if we can remove | ||
125 | # the entire ${S} in this case. | ||
126 | s_dir = d.getVar('S', True) | ||
127 | p_dir = os.path.join(s_dir, 'patches') | ||
128 | bb.utils.remove(p_dir, True) | ||
129 | |||
124 | try: | 130 | try: |
125 | fetcher = bb.fetch2.Fetch(src_uri, d) | 131 | fetcher = bb.fetch2.Fetch(src_uri, d) |
126 | fetcher.unpack(rootdir) | 132 | fetcher.unpack(rootdir) |
127 | except bb.fetch2.BBFetchException as e: | 133 | except bb.fetch2.BBFetchException as e: |
128 | raise bb.build.FuncFailed(e) | 134 | raise bb.build.FuncFailed(e) |
135 | |||
136 | if not os.path.exists(s_dir): | ||
137 | bb.warn("%s ('S') don't exist, you must set 'S' to a proper value" % s_dir) | ||
129 | } | 138 | } |
130 | 139 | ||
131 | def pkgarch_mapping(d): | 140 | def pkgarch_mapping(d): |
@@ -220,7 +229,7 @@ CONFIGURESTAMPFILE = "${WORKDIR}/configure.sstate" | |||
220 | CLEANBROKEN = "0" | 229 | CLEANBROKEN = "0" |
221 | 230 | ||
222 | addtask configure after do_patch | 231 | addtask configure after do_patch |
223 | do_configure[dirs] = "${S} ${B}" | 232 | do_configure[dirs] = "${B}" |
224 | do_configure[deptask] = "do_populate_sysroot" | 233 | do_configure[deptask] = "do_populate_sysroot" |
225 | base_do_configure() { | 234 | base_do_configure() { |
226 | if [ -n "${CONFIGURESTAMPFILE}" -a -e "${CONFIGURESTAMPFILE}" ]; then | 235 | if [ -n "${CONFIGURESTAMPFILE}" -a -e "${CONFIGURESTAMPFILE}" ]; then |
@@ -238,7 +247,7 @@ base_do_configure() { | |||
238 | } | 247 | } |
239 | 248 | ||
240 | addtask compile after do_configure | 249 | addtask compile after do_configure |
241 | do_compile[dirs] = "${S} ${B}" | 250 | do_compile[dirs] = "${B}" |
242 | base_do_compile() { | 251 | base_do_compile() { |
243 | if [ -e Makefile -o -e makefile -o -e GNUmakefile ]; then | 252 | if [ -e Makefile -o -e makefile -o -e GNUmakefile ]; then |
244 | oe_runmake || die "make failed" | 253 | oe_runmake || die "make failed" |
@@ -248,7 +257,7 @@ base_do_compile() { | |||
248 | } | 257 | } |
249 | 258 | ||
250 | addtask install after do_compile | 259 | addtask install after do_compile |
251 | do_install[dirs] = "${D} ${S} ${B}" | 260 | do_install[dirs] = "${D} ${B}" |
252 | # Remove and re-create ${D} so that is it guaranteed to be empty | 261 | # Remove and re-create ${D} so that is it guaranteed to be empty |
253 | do_install[cleandirs] = "${D}" | 262 | do_install[cleandirs] = "${D}" |
254 | 263 | ||