diff options
author | Richard Purdie <richard@openedhand.com> | 2007-08-21 09:37:30 +0000 |
---|---|---|
committer | Richard Purdie <richard@openedhand.com> | 2007-08-21 09:37:30 +0000 |
commit | 48fd37f5f9f2907d2c6f5d547e8471b232eadc90 (patch) | |
tree | 44b13b0d5d4381cce7cab8edd62fdd817d97ac6d /meta/classes | |
parent | 005bf0112ced82ef5e98de4854c0fa749e52d4d6 (diff) | |
download | poky-48fd37f5f9f2907d2c6f5d547e8471b232eadc90.tar.gz |
packaging: Split deb and ipk creation into separate tasks so changing the packaging type means the new type of packages are automatically generated.
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@2526 311d38ba-8fff-0310-9ca6-ca027cbcb966
Diffstat (limited to 'meta/classes')
-rw-r--r-- | meta/classes/image.bbclass | 3 | ||||
-rw-r--r-- | meta/classes/package.bbclass | 19 | ||||
-rw-r--r-- | meta/classes/package_deb.bbclass | 17 | ||||
-rw-r--r-- | meta/classes/package_ipk.bbclass | 16 | ||||
-rw-r--r-- | meta/classes/package_rpm.bbclass | 18 | ||||
-rw-r--r-- | meta/classes/package_tar.bbclass | 21 | ||||
-rw-r--r-- | meta/classes/rootfs_deb.bbclass | 1 | ||||
-rw-r--r-- | meta/classes/rootfs_ipk.bbclass | 1 |
8 files changed, 61 insertions, 35 deletions
diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass index ec08017cd1..517868ed3e 100644 --- a/meta/classes/image.bbclass +++ b/meta/classes/image.bbclass | |||
@@ -8,8 +8,7 @@ export IMAGE_BASENAME = "${PN}" | |||
8 | export PACKAGE_INSTALL = "${IMAGE_INSTALL}" | 8 | export PACKAGE_INSTALL = "${IMAGE_INSTALL}" |
9 | 9 | ||
10 | # We need to recursively follow RDEPENDS and RRECOMMENDS for images | 10 | # We need to recursively follow RDEPENDS and RRECOMMENDS for images |
11 | BUILD_ALL_DEPS = "1" | 11 | do_rootfs[recrdeptask] += "do_deploy do_populate_staging" |
12 | do_rootfs[recrdeptask] = "do_package_write do_deploy do_populate_staging" | ||
13 | 12 | ||
14 | # Images are generally built explicitly, do not need to be part of world. | 13 | # Images are generally built explicitly, do not need to be part of world. |
15 | EXCLUDE_FROM_WORLD = "1" | 14 | EXCLUDE_FROM_WORLD = "1" |
diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass index 6c25b0d7de..e1a7d91a9e 100644 --- a/meta/classes/package.bbclass +++ b/meta/classes/package.bbclass | |||
@@ -126,11 +126,6 @@ python () { | |||
126 | deps += " %s:do_populate_staging" % dep | 126 | deps += " %s:do_populate_staging" % dep |
127 | bb.data.setVarFlag('do_package', 'depends', deps, d) | 127 | bb.data.setVarFlag('do_package', 'depends', deps, d) |
128 | 128 | ||
129 | deps = bb.data.getVarFlag('do_package_write', 'depends', d) or "" | ||
130 | for dep in (bb.data.getVar('PACKAGE_EXTRA_DEPENDS', d, True) or "").split(): | ||
131 | deps += " %s:do_populate_staging" % dep | ||
132 | bb.data.setVarFlag('do_package_write', 'depends', deps, d) | ||
133 | |||
134 | # shlibs requires any DEPENDS to have already packaged for the *.list files | 129 | # shlibs requires any DEPENDS to have already packaged for the *.list files |
135 | bb.data.setVarFlag('do_package', 'deptask', 'do_package', d) | 130 | bb.data.setVarFlag('do_package', 'deptask', 'do_package', d) |
136 | } | 131 | } |
@@ -902,19 +897,7 @@ do_package[dirs] = "${D}" | |||
902 | addtask package before do_build after do_install | 897 | addtask package before do_build after do_install |
903 | 898 | ||
904 | 899 | ||
905 | 900 | EXPORT_FUNCTIONS do_package | |
906 | PACKAGE_WRITE_FUNCS ?= "read_subpackage_metadata" | ||
907 | |||
908 | python package_do_package_write () { | ||
909 | for f in (bb.data.getVar('PACKAGE_WRITE_FUNCS', d, 1) or '').split(): | ||
910 | bb.build.exec_func(f, d) | ||
911 | } | ||
912 | do_package_write[dirs] = "${D}" | ||
913 | addtask package_write before do_build after do_package | ||
914 | |||
915 | |||
916 | EXPORT_FUNCTIONS do_package do_package_write | ||
917 | |||
918 | 901 | ||
919 | # | 902 | # |
920 | # Helper functions for the package writing classes | 903 | # Helper functions for the package writing classes |
diff --git a/meta/classes/package_deb.bbclass b/meta/classes/package_deb.bbclass index 9a8db4f8f2..c5452475c4 100644 --- a/meta/classes/package_deb.bbclass +++ b/meta/classes/package_deb.bbclass | |||
@@ -4,11 +4,8 @@ | |||
4 | 4 | ||
5 | inherit package | 5 | inherit package |
6 | 6 | ||
7 | PACKAGE_EXTRA_DEPENDS += "dpkg-native fakeroot-native" | ||
8 | |||
9 | BOOTSTRAP_EXTRA_RDEPENDS += "dpkg" | 7 | BOOTSTRAP_EXTRA_RDEPENDS += "dpkg" |
10 | DISTRO_EXTRA_RDEPENDS += "dpkg" | 8 | DISTRO_EXTRA_RDEPENDS += "dpkg" |
11 | PACKAGE_WRITE_FUNCS += "do_package_deb" | ||
12 | IMAGE_PKGTYPE ?= "deb" | 9 | IMAGE_PKGTYPE ?= "deb" |
13 | 10 | ||
14 | python package_deb_fn () { | 11 | python package_deb_fn () { |
@@ -248,3 +245,17 @@ python do_package_deb () { | |||
248 | pass | 245 | pass |
249 | del localdata | 246 | del localdata |
250 | } | 247 | } |
248 | |||
249 | python () { | ||
250 | import bb | ||
251 | if bb.data.getVar('PACKAGES', d, True) != '': | ||
252 | bb.data.setVarFlag('do_package_write_deb', 'depends', 'dpkg-native:do_populate_staging fakeroot-native:do_populate_staging', d) | ||
253 | } | ||
254 | |||
255 | python do_package_write_deb () { | ||
256 | bb.build.exec_func("read_subpackage_metadata", d) | ||
257 | bb.build.exec_func("do_package_deb", d) | ||
258 | } | ||
259 | do_package_write_deb[dirs] = "${D}" | ||
260 | addtask package_write_deb before do_build after do_package | ||
261 | |||
diff --git a/meta/classes/package_ipk.bbclass b/meta/classes/package_ipk.bbclass index 0cdd941f41..2c75cd1838 100644 --- a/meta/classes/package_ipk.bbclass +++ b/meta/classes/package_ipk.bbclass | |||
@@ -1,10 +1,7 @@ | |||
1 | inherit package | 1 | inherit package |
2 | 2 | ||
3 | PACKAGE_EXTRA_DEPENDS += "ipkg-utils-native fakeroot-native" | ||
4 | |||
5 | BOOTSTRAP_EXTRA_RDEPENDS += "ipkg-collateral ipkg ipkg-link" | 3 | BOOTSTRAP_EXTRA_RDEPENDS += "ipkg-collateral ipkg ipkg-link" |
6 | DISTRO_EXTRA_RDEPENDS += "ipkg-collateral ipkg ipkg-link" | 4 | DISTRO_EXTRA_RDEPENDS += "ipkg-collateral ipkg ipkg-link" |
7 | PACKAGE_WRITE_FUNCS += "do_package_ipk" | ||
8 | IMAGE_PKGTYPE ?= "ipk" | 5 | IMAGE_PKGTYPE ?= "ipk" |
9 | 6 | ||
10 | python package_ipk_fn () { | 7 | python package_ipk_fn () { |
@@ -242,3 +239,16 @@ python do_package_ipk () { | |||
242 | pass | 239 | pass |
243 | del localdata | 240 | del localdata |
244 | } | 241 | } |
242 | |||
243 | python () { | ||
244 | import bb | ||
245 | if bb.data.getVar('PACKAGES', d, True) != '': | ||
246 | bb.data.setVarFlag('do_package_write_ipk', 'depends', 'ipkg-utils-native:do_populate_staging fakeroot-native:do_populate_staging', d) | ||
247 | } | ||
248 | |||
249 | python do_package_write_ipk () { | ||
250 | bb.build.exec_func("read_subpackage_metadata", d) | ||
251 | bb.build.exec_func("do_package_ipk", d) | ||
252 | } | ||
253 | do_package_write_ipk[dirs] = "${D}" | ||
254 | addtask package_write_ipk before do_build after do_package | ||
diff --git a/meta/classes/package_rpm.bbclass b/meta/classes/package_rpm.bbclass index 4955792916..7fc5e8ea96 100644 --- a/meta/classes/package_rpm.bbclass +++ b/meta/classes/package_rpm.bbclass | |||
@@ -2,7 +2,6 @@ inherit package | |||
2 | inherit rpm_core | 2 | inherit rpm_core |
3 | 3 | ||
4 | RPMBUILD="rpmbuild --short-circuit ${RPMOPTS}" | 4 | RPMBUILD="rpmbuild --short-circuit ${RPMOPTS}" |
5 | PACKAGE_WRITE_FUNCS += "do_package_rpm" | ||
6 | IMAGE_PKGTYPE ?= "rpm" | 5 | IMAGE_PKGTYPE ?= "rpm" |
7 | 6 | ||
8 | python write_specfile() { | 7 | python write_specfile() { |
@@ -54,7 +53,6 @@ python write_specfile() { | |||
54 | except OSError: | 53 | except OSError: |
55 | raise bb.build.FuncFailed("unable to open spec file for writing.") | 54 | raise bb.build.FuncFailed("unable to open spec file for writing.") |
56 | 55 | ||
57 | # fd = sys.__stdout__ | ||
58 | fd = specfile | 56 | fd = specfile |
59 | for var in out_vartranslate.keys(): | 57 | for var in out_vartranslate.keys(): |
60 | if out_vartranslate[var][0] == "%": | 58 | if out_vartranslate[var][0] == "%": |
@@ -123,7 +121,7 @@ python do_package_rpm () { | |||
123 | bb.data.setVar('OVERRIDES', '%s:%s' % (overrides, pkg), localdata) | 121 | bb.data.setVar('OVERRIDES', '%s:%s' % (overrides, pkg), localdata) |
124 | 122 | ||
125 | bb.data.update_data(localdata) | 123 | bb.data.update_data(localdata) |
126 | # stuff | 124 | |
127 | root = bb.data.getVar('ROOT', localdata) | 125 | root = bb.data.getVar('ROOT', localdata) |
128 | basedir = os.path.dirname(root) | 126 | basedir = os.path.dirname(root) |
129 | pkgoutdir = outdir | 127 | pkgoutdir = outdir |
@@ -132,3 +130,17 @@ python do_package_rpm () { | |||
132 | bb.build.exec_func('write_specfile', localdata) | 130 | bb.build.exec_func('write_specfile', localdata) |
133 | del localdata | 131 | del localdata |
134 | } | 132 | } |
133 | |||
134 | python () { | ||
135 | import bb | ||
136 | if bb.data.getVar('PACKAGES', d, True) != '': | ||
137 | bb.data.setVarFlag('do_package_write_rpm', 'depends', 'rpm-native:do_populate_staging', d) | ||
138 | } | ||
139 | |||
140 | |||
141 | python do_package_write_rpm () { | ||
142 | bb.build.exec_func("read_subpackage_metadata", d) | ||
143 | bb.build.exec_func("do_package_rpm", d) | ||
144 | } | ||
145 | do_package_write_rpm[dirs] = "${D}" | ||
146 | addtask package_write_rpm before do_build after do_package | ||
diff --git a/meta/classes/package_tar.bbclass b/meta/classes/package_tar.bbclass index 17216a86f4..cb4c42b261 100644 --- a/meta/classes/package_tar.bbclass +++ b/meta/classes/package_tar.bbclass | |||
@@ -1,8 +1,5 @@ | |||
1 | inherit package | 1 | inherit package |
2 | 2 | ||
3 | PACKAGE_EXTRA_DEPENDS += "tar-native" | ||
4 | |||
5 | PACKAGE_WRITE_FUNCS += "do_package_tar" | ||
6 | IMAGE_PKGTYPE ?= "tar" | 3 | IMAGE_PKGTYPE ?= "tar" |
7 | 4 | ||
8 | python package_tar_fn () { | 5 | python package_tar_fn () { |
@@ -78,7 +75,7 @@ python do_package_tar () { | |||
78 | bb.data.setVar('OVERRIDES', '%s:%s' % (overrides, pkg), localdata) | 75 | bb.data.setVar('OVERRIDES', '%s:%s' % (overrides, pkg), localdata) |
79 | 76 | ||
80 | bb.data.update_data(localdata) | 77 | bb.data.update_data(localdata) |
81 | # stuff | 78 | |
82 | root = bb.data.getVar('ROOT', localdata) | 79 | root = bb.data.getVar('ROOT', localdata) |
83 | bb.mkdirhier(root) | 80 | bb.mkdirhier(root) |
84 | basedir = os.path.dirname(root) | 81 | basedir = os.path.dirname(root) |
@@ -97,6 +94,18 @@ python do_package_tar () { | |||
97 | ret = os.system("tar -czvf %s %s" % (tarfn, '.')) | 94 | ret = os.system("tar -czvf %s %s" % (tarfn, '.')) |
98 | if ret != 0: | 95 | if ret != 0: |
99 | bb.error("Creation of tar %s failed." % tarfn) | 96 | bb.error("Creation of tar %s failed." % tarfn) |
100 | # end stuff | ||
101 | del localdata | ||
102 | } | 97 | } |
98 | |||
99 | python () { | ||
100 | import bb | ||
101 | if bb.data.getVar('PACKAGES', d, True) != '': | ||
102 | bb.data.setVarFlag('do_package_write_tar', 'depends', 'tar-native:do_populate_staging', d) | ||
103 | } | ||
104 | |||
105 | |||
106 | python do_package_write_tar () { | ||
107 | bb.build.exec_func("read_subpackage_metadata", d) | ||
108 | bb.build.exec_func("do_package_tar", d) | ||
109 | } | ||
110 | do_package_write_tar[dirs] = "${D}" | ||
111 | addtask package_write_tar before do_build after do_package | ||
diff --git a/meta/classes/rootfs_deb.bbclass b/meta/classes/rootfs_deb.bbclass index 55dad6679a..6d405d2f51 100644 --- a/meta/classes/rootfs_deb.bbclass +++ b/meta/classes/rootfs_deb.bbclass | |||
@@ -3,6 +3,7 @@ | |||
3 | # | 3 | # |
4 | 4 | ||
5 | do_rootfs[depends] += "dpkg-native:do_populate_staging apt-native:do_populate_staging" | 5 | do_rootfs[depends] += "dpkg-native:do_populate_staging apt-native:do_populate_staging" |
6 | do_rootfs[recrdeptask] += "do_package_write_deb" | ||
6 | 7 | ||
7 | fakeroot rootfs_deb_do_rootfs () { | 8 | fakeroot rootfs_deb_do_rootfs () { |
8 | set +e | 9 | set +e |
diff --git a/meta/classes/rootfs_ipk.bbclass b/meta/classes/rootfs_ipk.bbclass index 89c35ab85b..c58b547742 100644 --- a/meta/classes/rootfs_ipk.bbclass +++ b/meta/classes/rootfs_ipk.bbclass | |||
@@ -6,6 +6,7 @@ | |||
6 | # | 6 | # |
7 | 7 | ||
8 | do_rootfs[depends] += "ipkg-native:do_populate_staging ipkg-utils-native:do_populate_staging" | 8 | do_rootfs[depends] += "ipkg-native:do_populate_staging ipkg-utils-native:do_populate_staging" |
9 | do_rootfs[recrdeptask] += "do_package_write_ipk" | ||
9 | 10 | ||
10 | IPKG_ARGS = "-f ${T}/ipkg.conf -o ${IMAGE_ROOTFS}" | 11 | IPKG_ARGS = "-f ${T}/ipkg.conf -o ${IMAGE_ROOTFS}" |
11 | 12 | ||