summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorMark Hatle <mark.hatle@windriver.com>2011-02-08 16:07:47 -0600
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-02-12 00:30:29 +0000
commit6f6bffe5df1edf10056f42d2c95ae68b6bb918f9 (patch)
tree55b8312587b5106dabf96cd5d79d24507284e80a /meta
parent9849e700adbd1391e71e1e88799772524fad9a5a (diff)
downloadpoky-6f6bffe5df1edf10056f42d2c95ae68b6bb918f9.tar.gz
package.bbclass: Breakout the strip from the populate_packages
Break out the file split/strip from the populate_packages. Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Diffstat (limited to 'meta')
-rw-r--r--meta/classes/package.bbclass58
1 files changed, 36 insertions, 22 deletions
diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
index fd29aaa031..fa1abf0dda 100644
--- a/meta/classes/package.bbclass
+++ b/meta/classes/package.bbclass
@@ -11,24 +11,27 @@
11# 11#
12# b) package_do_split_locales - Split out the locale files, updates FILES and PACKAGES 12# b) package_do_split_locales - Split out the locale files, updates FILES and PACKAGES
13# 13#
14# c) populate_packages - Split the files in PKGD into separate packages in PKGDEST/<pkgname> 14# c) split_and_strip_files - split the files into runtime and debug and strip them.
15# Debug files include debug info split, and associated sources that end up in -dbg packages
16#
17# d) populate_packages - Split the files in PKGD into separate packages in PKGDEST/<pkgname>
15# Also triggers the binary stripping code to put files in -dbg packages. 18# Also triggers the binary stripping code to put files in -dbg packages.
16# 19#
17# d) package_do_filedeps - Collect perfile run-time dependency metadata 20# e) package_do_filedeps - Collect perfile run-time dependency metadata
18# The data is stores in FILER{PROVIDES,DEPENDS}_file_pkg variables with 21# The data is stores in FILER{PROVIDES,DEPENDS}_file_pkg variables with
19# a list of affected files in FILER{PROVIDES,DEPENDS}FLIST_pkg 22# a list of affected files in FILER{PROVIDES,DEPENDS}FLIST_pkg
20# 23#
21# e) package_do_shlibs - Look at the shared libraries generated and autotmatically add any 24# f) package_do_shlibs - Look at the shared libraries generated and autotmatically add any
22# depenedencies found. Also stores the package name so anyone else using this library 25# depenedencies found. Also stores the package name so anyone else using this library
23# knows which package to depend on. 26# knows which package to depend on.
24# 27#
25# f) package_do_pkgconfig - Keep track of which packages need and provide which .pc files 28# g) package_do_pkgconfig - Keep track of which packages need and provide which .pc files
26# 29#
27# g) read_shlibdeps - Reads the stored shlibs information into the metadata 30# h) read_shlibdeps - Reads the stored shlibs information into the metadata
28# 31#
29# h) package_depchains - Adds automatic dependencies to -dbg and -dev packages 32# i) package_depchains - Adds automatic dependencies to -dbg and -dev packages
30# 33#
31# i) emit_pkgdata - saves the packaging data into PKGDATA_DIR for use in later 34# j) emit_pkgdata - saves the packaging data into PKGDATA_DIR for use in later
32# packaging steps 35# packaging steps
33 36
34inherit packagedata 37inherit packagedata
@@ -163,7 +166,7 @@ python () {
163} 166}
164 167
165def runstrip(file, d): 168def runstrip(file, d):
166 # Function to strip a single file, called from populate_packages below 169 # Function to strip a single file, called from split_and_strip_files below
167 # A working 'file' (one which works on the target architecture) 170 # A working 'file' (one which works on the target architecture)
168 # is necessary for this stuff to work, hence the addition to do_package[depends] 171 # is necessary for this stuff to work, hence the addition to do_package[depends]
169 172
@@ -329,16 +332,11 @@ python perform_packagecopy () {
329 os.system('tar -cf - -C %s -ps . | tar -xf - -C %s' % (dest, dvar)) 332 os.system('tar -cf - -C %s -ps . | tar -xf - -C %s' % (dest, dvar))
330} 333}
331 334
332python populate_packages () { 335python split_and_strip_files () {
333 import glob, stat, errno, re 336 import stat
334 337
335 workdir = bb.data.getVar('WORKDIR', d, True)
336 outdir = bb.data.getVar('DEPLOY_DIR', d, True)
337 dvar = bb.data.getVar('PKGD', d, True) 338 dvar = bb.data.getVar('PKGD', d, True)
338 packages = bb.data.getVar('PACKAGES', d, True)
339 pn = bb.data.getVar('PN', d, True)
340 339
341 bb.mkdirhier(outdir)
342 os.chdir(dvar) 340 os.chdir(dvar)
343 341
344 def isexec(path): 342 def isexec(path):
@@ -348,6 +346,28 @@ python populate_packages () {
348 return 0 346 return 0
349 return (s[stat.ST_MODE] & stat.S_IEXEC) 347 return (s[stat.ST_MODE] & stat.S_IEXEC)
350 348
349 # Figure out which packages we want to process
350 if (bb.data.getVar('INHIBIT_PACKAGE_STRIP', d, True) != '1'):
351 for root, dirs, files in os.walk(dvar):
352 for f in files:
353 file = os.path.join(root, f)
354 if not os.path.islink(file) and not os.path.isdir(file) and isexec(file):
355 runstrip(file, d)
356
357}
358
359python populate_packages () {
360 import glob, stat, errno, re
361
362 workdir = bb.data.getVar('WORKDIR', d, True)
363 outdir = bb.data.getVar('DEPLOY_DIR', d, True)
364 dvar = bb.data.getVar('PKGD', d, True)
365 packages = bb.data.getVar('PACKAGES', d, True)
366 pn = bb.data.getVar('PN', d, True)
367
368 bb.mkdirhier(outdir)
369 os.chdir(dvar)
370
351 # Sanity check PACKAGES for duplicates - should be moved to 371 # Sanity check PACKAGES for duplicates - should be moved to
352 # sanity.bbclass once we have the infrastucture 372 # sanity.bbclass once we have the infrastucture
353 package_list = [] 373 package_list = []
@@ -360,13 +380,6 @@ python populate_packages () {
360 else: 380 else:
361 package_list.append(pkg) 381 package_list.append(pkg)
362 382
363 if (bb.data.getVar('INHIBIT_PACKAGE_STRIP', d, True) != '1'):
364 for root, dirs, files in os.walk(dvar):
365 for f in files:
366 file = os.path.join(root, f)
367 if not os.path.islink(file) and not os.path.isdir(file) and isexec(file):
368 runstrip(file, d)
369
370 pkgdest = bb.data.getVar('PKGDEST', d, True) 383 pkgdest = bb.data.getVar('PKGDEST', d, True)
371 os.system('rm -rf %s' % pkgdest) 384 os.system('rm -rf %s' % pkgdest)
372 385
@@ -1081,6 +1094,7 @@ PACKAGE_PREPROCESS_FUNCS ?= ""
1081PACKAGEFUNCS ?= "perform_packagecopy \ 1094PACKAGEFUNCS ?= "perform_packagecopy \
1082 ${PACKAGE_PREPROCESS_FUNCS} \ 1095 ${PACKAGE_PREPROCESS_FUNCS} \
1083 package_do_split_locales \ 1096 package_do_split_locales \
1097 split_and_strip_files \
1084 populate_packages \ 1098 populate_packages \
1085 package_do_filedeps \ 1099 package_do_filedeps \
1086 package_do_shlibs \ 1100 package_do_shlibs \