diff options
| author | Richard Purdie <rpurdie@linux.intel.com> | 2009-10-29 23:55:43 +0000 |
|---|---|---|
| committer | Richard Purdie <rpurdie@linux.intel.com> | 2009-11-13 12:15:22 +0000 |
| commit | 4b0332c4319feb701aa54b3ed11cfacb2cf3b0a9 (patch) | |
| tree | 69dcd807e85fb4cc7a1736ba3f2ef24d60f61404 /meta/classes/package.bbclass | |
| parent | 0eee29e45161195663ccf5a795aada97257f1832 (diff) | |
| download | poky-4b0332c4319feb701aa54b3ed11cfacb2cf3b0a9.tar.gz | |
package.bbclass: Change to operate on a copy of the install directory instead of directly. Also take the opportunity to rename the temp directories so their function is clear
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'meta/classes/package.bbclass')
| -rw-r--r-- | meta/classes/package.bbclass | 37 |
1 files changed, 25 insertions, 12 deletions
diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass index 7928fe9f6b..2f1727440e 100644 --- a/meta/classes/package.bbclass +++ b/meta/classes/package.bbclass | |||
| @@ -4,7 +4,8 @@ | |||
| 4 | 4 | ||
| 5 | inherit packagedata | 5 | inherit packagedata |
| 6 | 6 | ||
| 7 | PKGDEST = "${WORKDIR}/install" | 7 | PKGD = "${WORKDIR}/package" |
| 8 | PKGDEST = "${WORKDIR}/packages-split" | ||
| 8 | 9 | ||
| 9 | def legitimize_package_name(s): | 10 | def legitimize_package_name(s): |
| 10 | """ | 11 | """ |
| @@ -30,7 +31,7 @@ def do_split_packages(d, root, file_regex, output_pattern, description, postinst | |||
| 30 | """ | 31 | """ |
| 31 | import os, os.path, bb | 32 | import os, os.path, bb |
| 32 | 33 | ||
| 33 | dvar = bb.data.getVar('D', d, True) | 34 | dvar = bb.data.getVar('PKGD', d, True) |
| 34 | 35 | ||
| 35 | packages = bb.data.getVar('PACKAGES', d, True).split() | 36 | packages = bb.data.getVar('PACKAGES', d, True).split() |
| 36 | 37 | ||
| @@ -238,7 +239,7 @@ python package_do_split_locales() { | |||
| 238 | bb.note("datadir not defined") | 239 | bb.note("datadir not defined") |
| 239 | return | 240 | return |
| 240 | 241 | ||
| 241 | dvar = bb.data.getVar('D', d, True) | 242 | dvar = bb.data.getVar('PKGD', d, True) |
| 242 | pn = bb.data.getVar('PN', d, True) | 243 | pn = bb.data.getVar('PN', d, True) |
| 243 | 244 | ||
| 244 | if pn + '-locale' in packages: | 245 | if pn + '-locale' in packages: |
| @@ -282,19 +283,29 @@ python package_do_split_locales() { | |||
| 282 | #bb.data.setVar('RDEPENDS_%s' % mainpkg, ' '.join(rdep), d) | 283 | #bb.data.setVar('RDEPENDS_%s' % mainpkg, ' '.join(rdep), d) |
| 283 | } | 284 | } |
| 284 | 285 | ||
| 286 | python perform_packagecopy () { | ||
| 287 | import os | ||
| 288 | |||
| 289 | dest = bb.data.getVar('D', d, True) | ||
| 290 | dvar = bb.data.getVar('PKGD', d, True) | ||
| 291 | |||
| 292 | bb.mkdirhier(dvar) | ||
| 293 | |||
| 294 | # Start by package population by taking a copy of the installed | ||
| 295 | # files to operate on | ||
| 296 | os.system('cp -pPR %s/* %s/' % (dest, dvar)) | ||
| 297 | } | ||
| 298 | |||
| 285 | python populate_packages () { | 299 | python populate_packages () { |
| 286 | import os, glob, stat, errno, re | 300 | import os, glob, stat, errno, re |
| 287 | 301 | ||
| 288 | workdir = bb.data.getVar('WORKDIR', d, True) | 302 | workdir = bb.data.getVar('WORKDIR', d, True) |
| 289 | outdir = bb.data.getVar('DEPLOY_DIR', d, True) | 303 | outdir = bb.data.getVar('DEPLOY_DIR', d, True) |
| 290 | dvar = bb.data.getVar('D', d, True) | 304 | dvar = bb.data.getVar('PKGD', d, True) |
| 291 | packages = bb.data.getVar('PACKAGES', d, True) | 305 | packages = bb.data.getVar('PACKAGES', d, True) |
| 292 | pn = bb.data.getVar('PN', d, True) | 306 | pn = bb.data.getVar('PN', d, True) |
| 293 | 307 | ||
| 294 | bb.mkdirhier(outdir) | 308 | bb.mkdirhier(outdir) |
| 295 | bb.mkdirhier(dvar) | ||
| 296 | |||
| 297 | |||
| 298 | os.chdir(dvar) | 309 | os.chdir(dvar) |
| 299 | 310 | ||
| 300 | def isexec(path): | 311 | def isexec(path): |
| @@ -592,7 +603,7 @@ python package_do_shlibs() { | |||
| 592 | if not combo in sonames: | 603 | if not combo in sonames: |
| 593 | sonames.append(combo) | 604 | sonames.append(combo) |
| 594 | if file.endswith('.dylib') or file.endswith('.so'): | 605 | if file.endswith('.dylib') or file.endswith('.so'): |
| 595 | lafile = fullpath.replace(os.path.join(pkgdest, pkg), bb.data.getVar('D', d, True)) | 606 | lafile = fullpath.replace(os.path.join(pkgdest, pkg), bb.data.getVar('PKGD', d, True)) |
| 596 | # Drop suffix | 607 | # Drop suffix |
| 597 | lafile = lafile.rsplit(".",1)[0] | 608 | lafile = lafile.rsplit(".",1)[0] |
| 598 | lapath = os.path.dirname(lafile) | 609 | lapath = os.path.dirname(lafile) |
| @@ -963,7 +974,8 @@ python package_depchains() { | |||
| 963 | } | 974 | } |
| 964 | 975 | ||
| 965 | 976 | ||
| 966 | PACKAGEFUNCS ?= "package_do_split_locales \ | 977 | PACKAGEFUNCS ?= "perform_packagecopy \ |
| 978 | package_do_split_locales \ | ||
| 967 | populate_packages \ | 979 | populate_packages \ |
| 968 | package_do_shlibs \ | 980 | package_do_shlibs \ |
| 969 | package_do_pkgconfig \ | 981 | package_do_pkgconfig \ |
| @@ -979,11 +991,12 @@ python package_do_package () { | |||
| 979 | 991 | ||
| 980 | workdir = bb.data.getVar('WORKDIR', d, True) | 992 | workdir = bb.data.getVar('WORKDIR', d, True) |
| 981 | outdir = bb.data.getVar('DEPLOY_DIR', d, True) | 993 | outdir = bb.data.getVar('DEPLOY_DIR', d, True) |
| 982 | dvar = bb.data.getVar('D', d, True) | 994 | dest = bb.data.getVar('D', d, True) |
| 995 | dvar = bb.data.getVar('PKGD', d, True) | ||
| 983 | pn = bb.data.getVar('PN', d, True) | 996 | pn = bb.data.getVar('PN', d, True) |
| 984 | 997 | ||
| 985 | if not workdir or not outdir or not dvar or not pn or not packages: | 998 | if not workdir or not outdir or not dest or not dvar or not pn or not packages: |
| 986 | bb.error("WORKDIR, DEPLOY_DIR, D, and PN all must be defined, unable to package") | 999 | bb.error("WORKDIR, DEPLOY_DIR, D, PN and PKGD all must be defined, unable to package") |
| 987 | return | 1000 | return |
| 988 | 1001 | ||
| 989 | for f in (bb.data.getVar('PACKAGEFUNCS', d, True) or '').split(): | 1002 | for f in (bb.data.getVar('PACKAGEFUNCS', d, True) or '').split(): |
