diff options
Diffstat (limited to 'meta')
-rw-r--r-- | meta/classes/base.bbclass | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass index 5d8e8d6701..f2e3d4092e 100644 --- a/meta/classes/base.bbclass +++ b/meta/classes/base.bbclass | |||
@@ -136,23 +136,21 @@ python base_do_fetch() { | |||
136 | 136 | ||
137 | addtask unpack after do_fetch | 137 | addtask unpack after do_fetch |
138 | do_unpack[dirs] = "${WORKDIR}" | 138 | do_unpack[dirs] = "${WORKDIR}" |
139 | |||
140 | python () { | ||
141 | if d.getVar('S', True) != d.getVar('WORKDIR', True): | ||
142 | d.setVarFlag('do_unpack', 'cleandirs', '${S}') | ||
143 | else: | ||
144 | d.setVarFlag('do_unpack', 'cleandirs', os.path.join('${S}', 'patches')) | ||
145 | } | ||
139 | python base_do_unpack() { | 146 | python base_do_unpack() { |
140 | src_uri = (d.getVar('SRC_URI', True) or "").split() | 147 | src_uri = (d.getVar('SRC_URI', True) or "").split() |
141 | if len(src_uri) == 0: | 148 | if len(src_uri) == 0: |
142 | return | 149 | return |
143 | 150 | ||
144 | rootdir = d.getVar('WORKDIR', True) | ||
145 | |||
146 | # Ensure that we cleanup ${S}/patches | ||
147 | # TODO: Investigate if we can remove | ||
148 | # the entire ${S} in this case. | ||
149 | s_dir = d.getVar('S', True) | ||
150 | p_dir = os.path.join(s_dir, 'patches') | ||
151 | bb.utils.remove(p_dir, True) | ||
152 | |||
153 | try: | 151 | try: |
154 | fetcher = bb.fetch2.Fetch(src_uri, d) | 152 | fetcher = bb.fetch2.Fetch(src_uri, d) |
155 | fetcher.unpack(rootdir) | 153 | fetcher.unpack(d.getVar('WORKDIR', True)) |
156 | except bb.fetch2.BBFetchException as e: | 154 | except bb.fetch2.BBFetchException as e: |
157 | raise bb.build.FuncFailed(e) | 155 | raise bb.build.FuncFailed(e) |
158 | } | 156 | } |