summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPetter Mabäcker <petter@technux.se>2015-01-04 23:45:46 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-01-23 11:36:28 +0000
commitcf72ede74d35746a10d0708942287548f9c72f30 (patch)
tree75cc16ad40b6de07a892bda4cc190996aaab75b0
parent4eb3db9a2ca8eaff64b64b8f56dac25d4734571c (diff)
downloadpoky-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>
-rw-r--r--meta/classes/base.bbclass17
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
114addtask unpack after do_fetch 114addtask unpack after do_fetch
115do_unpack[dirs] = "${WORKDIR}" 115do_unpack[dirs] = "${WORKDIR}"
116do_unpack[cleandirs] = "${S}/patches"
117python base_do_unpack() { 116python 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
131def pkgarch_mapping(d): 140def pkgarch_mapping(d):
@@ -220,7 +229,7 @@ CONFIGURESTAMPFILE = "${WORKDIR}/configure.sstate"
220CLEANBROKEN = "0" 229CLEANBROKEN = "0"
221 230
222addtask configure after do_patch 231addtask configure after do_patch
223do_configure[dirs] = "${S} ${B}" 232do_configure[dirs] = "${B}"
224do_configure[deptask] = "do_populate_sysroot" 233do_configure[deptask] = "do_populate_sysroot"
225base_do_configure() { 234base_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
240addtask compile after do_configure 249addtask compile after do_configure
241do_compile[dirs] = "${S} ${B}" 250do_compile[dirs] = "${B}"
242base_do_compile() { 251base_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
250addtask install after do_compile 259addtask install after do_compile
251do_install[dirs] = "${D} ${S} ${B}" 260do_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
253do_install[cleandirs] = "${D}" 262do_install[cleandirs] = "${D}"
254 263