diff options
author | Richard Purdie <richard@openedhand.com> | 2008-04-27 10:48:16 +0000 |
---|---|---|
committer | Richard Purdie <richard@openedhand.com> | 2008-04-27 10:48:16 +0000 |
commit | 192e4fb821f7158fdeeee129f8c3d8f27dd2ea1a (patch) | |
tree | efc5abe7e8aa319d20012ee7235db4787313d0c7 /meta/classes | |
parent | 04e667e2e1f495b8563a28a83d49b4bd0c493963 (diff) | |
download | poky-192e4fb821f7158fdeeee129f8c3d8f27dd2ea1a.tar.gz |
base.bbclass: Add setscene task to handle preparing the work area at the start of a given task, fixing the handling of the rebuild task. This task removes the need for do_prepackaged_stage in packaged-staging.bbclass.
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@4351 311d38ba-8fff-0310-9ca6-ca027cbcb966
Diffstat (limited to 'meta/classes')
-rw-r--r-- | meta/classes/base.bbclass | 22 | ||||
-rw-r--r-- | meta/classes/packaged-staging.bbclass | 13 |
2 files changed, 24 insertions, 11 deletions
diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass index 010b617721..b7459bc996 100644 --- a/meta/classes/base.bbclass +++ b/meta/classes/base.bbclass | |||
@@ -464,6 +464,24 @@ python base_do_mrproper() { | |||
464 | bb.build.exec_func('do_clean', d) | 464 | bb.build.exec_func('do_clean', d) |
465 | } | 465 | } |
466 | 466 | ||
467 | SCENEFUNCS += "base_scenefunction" | ||
468 | |||
469 | python base_do_setscene () { | ||
470 | for f in (bb.data.getVar('SCENEFUNCS', d, 1) or '').split(): | ||
471 | bb.build.exec_func(f, d) | ||
472 | if not os.path.exists(bb.data.getVar('STAMP', d, 1) + ".do_setscene"): | ||
473 | bb.build.make_stamp("do_setscene", d) | ||
474 | } | ||
475 | do_setscene[selfstamp] = "1" | ||
476 | addtask setscene before do_fetch | ||
477 | |||
478 | python base_scenefunction () { | ||
479 | stamp = bb.data.getVar('STAMP', d, 1) + ".needclean" | ||
480 | if os.path.exists(stamp): | ||
481 | bb.build.exec_func("do_clean", d) | ||
482 | } | ||
483 | |||
484 | |||
467 | addtask fetch | 485 | addtask fetch |
468 | do_fetch[dirs] = "${DL_DIR}" | 486 | do_fetch[dirs] = "${DL_DIR}" |
469 | do_fetch[depends] = "shasum-native:do_populate_staging" | 487 | do_fetch[depends] = "shasum-native:do_populate_staging" |
@@ -604,7 +622,6 @@ def oe_unpack_file(file, data, url = None): | |||
604 | return ret == 0 | 622 | return ret == 0 |
605 | 623 | ||
606 | addtask unpack after do_fetch | 624 | addtask unpack after do_fetch |
607 | do_unpack[cleandirs] = "${WORKDIR}" | ||
608 | do_unpack[dirs] = "${WORKDIR}" | 625 | do_unpack[dirs] = "${WORKDIR}" |
609 | python base_do_unpack() { | 626 | python base_do_unpack() { |
610 | import re, os | 627 | import re, os |
@@ -707,6 +724,7 @@ python base_eventhandler() { | |||
707 | dir = "%s.*" % e.stampPrefix[fn] | 724 | dir = "%s.*" % e.stampPrefix[fn] |
708 | bb.note("Removing stamps: " + dir) | 725 | bb.note("Removing stamps: " + dir) |
709 | os.system('rm -f '+ dir) | 726 | os.system('rm -f '+ dir) |
727 | os.system('touch ' + e.stampPrefix[fn] + '.needclean') | ||
710 | 728 | ||
711 | if not data in e.__dict__: | 729 | if not data in e.__dict__: |
712 | return NotHandled | 730 | return NotHandled |
@@ -972,7 +990,7 @@ inherit patch | |||
972 | # Move to autotools.bbclass? | 990 | # Move to autotools.bbclass? |
973 | inherit siteinfo | 991 | inherit siteinfo |
974 | 992 | ||
975 | EXPORT_FUNCTIONS do_clean do_mrproper do_fetch do_unpack do_configure do_compile do_install do_package do_populate_pkgs do_stage do_rebuild do_fetchall | 993 | EXPORT_FUNCTIONS do_setscene do_clean do_mrproper do_fetch do_unpack do_configure do_compile do_install do_package do_populate_pkgs do_stage do_rebuild do_fetchall |
976 | 994 | ||
977 | MIRRORS[func] = "0" | 995 | MIRRORS[func] = "0" |
978 | MIRRORS () { | 996 | MIRRORS () { |
diff --git a/meta/classes/packaged-staging.bbclass b/meta/classes/packaged-staging.bbclass index 1df2a2c9f0..e6f2f3b53e 100644 --- a/meta/classes/packaged-staging.bbclass +++ b/meta/classes/packaged-staging.bbclass | |||
@@ -123,7 +123,9 @@ staging_helper () { | |||
123 | 123 | ||
124 | PSTAGE_TASKS_COVERED = "fetch unpack munge patch configure qa_configure rig_locales compile sizecheck install deploy package populate_staging package_write_deb package_write_ipk package_write package_stage qa_staging" | 124 | PSTAGE_TASKS_COVERED = "fetch unpack munge patch configure qa_configure rig_locales compile sizecheck install deploy package populate_staging package_write_deb package_write_ipk package_write package_stage qa_staging" |
125 | 125 | ||
126 | python do_prepackaged_stage () { | 126 | SCENEFUNCS += "packagestage_scenefunc" |
127 | |||
128 | python packagestage_scenefunc () { | ||
127 | import os | 129 | import os |
128 | 130 | ||
129 | if bb.data.getVar("PSTAGING_ACTIVE", d, 1) == "0": | 131 | if bb.data.getVar("PSTAGING_ACTIVE", d, 1) == "0": |
@@ -156,17 +158,10 @@ python do_prepackaged_stage () { | |||
156 | if ret != 0: | 158 | if ret != 0: |
157 | bb.note("Failure installing prestage package") | 159 | bb.note("Failure installing prestage package") |
158 | 160 | ||
159 | #bb.build.make_stamp("do_prepackaged_stage", d) | ||
160 | #for task in bb.data.getVar("PSTAGE_TASKS_COVERED", d, 1).split(): | ||
161 | # bb.build.make_stamp("do_" + task, d) | ||
162 | bb.build.make_stamp("do_stage_package_populated", d) | 161 | bb.build.make_stamp("do_stage_package_populated", d) |
163 | 162 | ||
164 | else: | ||
165 | bb.build.make_stamp("do_prepackaged_stage", d) | ||
166 | } | 163 | } |
167 | do_prepackaged_stage[cleandirs] = "${PSTAGE_TMPDIR_STAGE}" | 164 | packagestage_scenefunc[cleandirs] = "${PSTAGE_TMPDIR_STAGE}" |
168 | do_prepackaged_stage[selfstamp] = "1" | ||
169 | addtask prepackaged_stage before do_fetch | ||
170 | 165 | ||
171 | addhandler packagedstage_stampfixing_eventhandler | 166 | addhandler packagedstage_stampfixing_eventhandler |
172 | python packagedstage_stampfixing_eventhandler() { | 167 | python packagedstage_stampfixing_eventhandler() { |