diff options
Diffstat (limited to 'meta')
-rw-r--r-- | meta/classes/rm_work.bbclass | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/meta/classes/rm_work.bbclass b/meta/classes/rm_work.bbclass index 2490a69c62..badeaeba07 100644 --- a/meta/classes/rm_work.bbclass +++ b/meta/classes/rm_work.bbclass | |||
@@ -121,10 +121,24 @@ rm_work_rootfs () { | |||
121 | } | 121 | } |
122 | rm_work_rootfs[cleandirs] = "${WORKDIR}/rootfs" | 122 | rm_work_rootfs[cleandirs] = "${WORKDIR}/rootfs" |
123 | 123 | ||
124 | # We have to add the do_rmwork task already now, because all tasks are | 124 | # This task can be used instead of do_build to trigger building |
125 | # without also invoking do_rm_work. It only exists when rm_work.bbclass | ||
126 | # is active, otherwise do_build needs to be used. | ||
127 | # | ||
128 | # The intended usage is | ||
129 | # ${@ d.getVar('RM_WORK_BUILD_WITHOUT') or 'do_build'} | ||
130 | # in places that previously used just 'do_build'. | ||
131 | RM_WORK_BUILD_WITHOUT = "do_build_without_rm_work" | ||
132 | do_build_without_rm_work () { | ||
133 | : | ||
134 | } | ||
135 | do_build_without_rm_work[noexec] = "1" | ||
136 | |||
137 | # We have to add these tasks already now, because all tasks are | ||
125 | # meant to be defined before the RecipeTaskPreProcess event triggers. | 138 | # meant to be defined before the RecipeTaskPreProcess event triggers. |
126 | # The inject_rm_work event handler then merely changes task dependencies. | 139 | # The inject_rm_work event handler then merely changes task dependencies. |
127 | addtask do_rm_work | 140 | addtask do_rm_work |
141 | addtask do_build_without_rm_work | ||
128 | addhandler inject_rm_work | 142 | addhandler inject_rm_work |
129 | inject_rm_work[eventmask] = "bb.event.RecipeTaskPreProcess" | 143 | inject_rm_work[eventmask] = "bb.event.RecipeTaskPreProcess" |
130 | python inject_rm_work() { | 144 | python inject_rm_work() { |
@@ -133,6 +147,12 @@ python inject_rm_work() { | |||
133 | # If the recipe name is in the RM_WORK_EXCLUDE, skip the recipe. | 147 | # If the recipe name is in the RM_WORK_EXCLUDE, skip the recipe. |
134 | excludes = (d.getVar("RM_WORK_EXCLUDE") or "").split() | 148 | excludes = (d.getVar("RM_WORK_EXCLUDE") or "").split() |
135 | pn = d.getVar("PN") | 149 | pn = d.getVar("PN") |
150 | |||
151 | # Determine what do_build depends upon, without including do_build | ||
152 | # itself or our own special do_rm_work_all. | ||
153 | deps = set(bb.build.preceedtask('do_build', True, d)) | ||
154 | deps.difference_update(('do_build', 'do_rm_work_all')) | ||
155 | |||
136 | if pn in excludes: | 156 | if pn in excludes: |
137 | d.delVarFlag('rm_work_rootfs', 'cleandirs') | 157 | d.delVarFlag('rm_work_rootfs', 'cleandirs') |
138 | d.delVarFlag('rm_work_populatesdk', 'cleandirs') | 158 | d.delVarFlag('rm_work_populatesdk', 'cleandirs') |
@@ -144,8 +164,9 @@ python inject_rm_work() { | |||
144 | # do_build inherits additional runtime dependencies on | 164 | # do_build inherits additional runtime dependencies on |
145 | # other recipes and thus will typically run much later than completion of | 165 | # other recipes and thus will typically run much later than completion of |
146 | # work in the recipe itself. | 166 | # work in the recipe itself. |
147 | deps = set(bb.build.preceedtask('do_build', True, d)) | ||
148 | deps.difference_update(('do_build', 'do_rm_work_all')) | ||
149 | # In practice, addtask() here merely updates the dependencies. | 167 | # In practice, addtask() here merely updates the dependencies. |
150 | bb.build.addtask('do_rm_work', 'do_build', ' '.join(deps), d) | 168 | bb.build.addtask('do_rm_work', 'do_build', ' '.join(deps), d) |
169 | |||
170 | # Always update do_build_without_rm_work dependencies. | ||
171 | bb.build.addtask('do_build_without_rm_work', '', ' '.join(deps), d) | ||
151 | } | 172 | } |