summaryrefslogtreecommitdiffstats
path: root/meta/classes/package.bbclass
diff options
context:
space:
mode:
authorLianhao Lu <lianhao.lu@intel.com>2011-05-18 21:15:01 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-05-27 17:55:49 +0100
commit66d27435beb471d883355cc942f1d4489ebdad68 (patch)
tree9459738a344c66143bf4ebc6753f2cad39824c61 /meta/classes/package.bbclass
parentf906608f68bb0640b61bb4f4986d77b6f30df0f9 (diff)
downloadpoky-66d27435beb471d883355cc942f1d4489ebdad68.tar.gz
classes/package(prserv).bbclass: Get PRAUTO and use PKGV/PKGR.
1. Added package_get_auto_pr to PACKAGEFUNCS to get the auto incremented value(PRAUTO) from remote PR service. 2. use PKGV/PKGR for pkgdata which will be used by package_write_xxx. 3. Added supporting functions in prserv.bbclass. (From OE-Core rev: b1f6120c04731d3d66f322ce550b0d223c118dab) Signed-off-by: Lianhao Lu <lianhao.lu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/package.bbclass')
-rw-r--r--meta/classes/package.bbclass51
1 files changed, 36 insertions, 15 deletions
diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
index 2c6d30ccd8..a1b948276f 100644
--- a/meta/classes/package.bbclass
+++ b/meta/classes/package.bbclass
@@ -7,34 +7,37 @@
7# 7#
8# There are the following default steps but PACKAGEFUNCS can be extended: 8# There are the following default steps but PACKAGEFUNCS can be extended:
9# 9#
10# a) perform_packagecopy - Copy D into PKGD 10# a) package_get_auto_pr - get PRAUTO from remote PR service
11# 11#
12# b) package_do_split_locales - Split out the locale files, updates FILES and PACKAGES 12# b) perform_packagecopy - Copy D into PKGD
13# 13#
14# c) split_and_strip_files - split the files into runtime and debug and strip them. 14# c) package_do_split_locales - Split out the locale files, updates FILES and PACKAGES
15#
16# d) 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 17# Debug files include debug info split, and associated sources that end up in -dbg packages
16# 18#
17# d) populate_packages - Split the files in PKGD into separate packages in PKGDEST/<pkgname> 19# e) populate_packages - Split the files in PKGD into separate packages in PKGDEST/<pkgname>
18# Also triggers the binary stripping code to put files in -dbg packages. 20# Also triggers the binary stripping code to put files in -dbg packages.
19# 21#
20# e) package_do_filedeps - Collect perfile run-time dependency metadata 22# f) package_do_filedeps - Collect perfile run-time dependency metadata
21# The data is stores in FILER{PROVIDES,DEPENDS}_file_pkg variables with 23# The data is stores in FILER{PROVIDES,DEPENDS}_file_pkg variables with
22# a list of affected files in FILER{PROVIDES,DEPENDS}FLIST_pkg 24# a list of affected files in FILER{PROVIDES,DEPENDS}FLIST_pkg
23# 25#
24# f) package_do_shlibs - Look at the shared libraries generated and autotmatically add any 26# g) package_do_shlibs - Look at the shared libraries generated and autotmatically add any
25# depenedencies found. Also stores the package name so anyone else using this library 27# depenedencies found. Also stores the package name so anyone else using this library
26# knows which package to depend on. 28# knows which package to depend on.
27# 29#
28# g) package_do_pkgconfig - Keep track of which packages need and provide which .pc files 30# h) package_do_pkgconfig - Keep track of which packages need and provide which .pc files
29# 31#
30# h) read_shlibdeps - Reads the stored shlibs information into the metadata 32# i) read_shlibdeps - Reads the stored shlibs information into the metadata
31# 33#
32# i) package_depchains - Adds automatic dependencies to -dbg and -dev packages 34# j) package_depchains - Adds automatic dependencies to -dbg and -dev packages
33# 35#
34# j) emit_pkgdata - saves the packaging data into PKGDATA_DIR for use in later 36# k) emit_pkgdata - saves the packaging data into PKGDATA_DIR for use in later
35# packaging steps 37# packaging steps
36 38
37inherit packagedata 39inherit packagedata
40inherit prserv
38 41
39PKGD = "${WORKDIR}/package" 42PKGD = "${WORKDIR}/package"
40PKGDEST = "${WORKDIR}/packages-split" 43PKGDEST = "${WORKDIR}/packages-split"
@@ -326,6 +329,15 @@ def runtime_mapping_rename (varname, d):
326# Package functions suitable for inclusion in PACKAGEFUNCS 329# Package functions suitable for inclusion in PACKAGEFUNCS
327# 330#
328 331
332python package_get_auto_pr() {
333 if d.getVar('USE_PR_SERV', True):
334 auto_pr=prserv_get_pr_auto(d)
335 if auto_pr is None:
336 bb.fatal("Can NOT get auto PR revision from remote PR service")
337 return
338 d.setVar('PRAUTO',str(auto_pr))
339}
340
329python package_do_split_locales() { 341python package_do_split_locales() {
330 if (bb.data.getVar('PACKAGE_NO_LOCALE', d, True) == '1'): 342 if (bb.data.getVar('PACKAGE_NO_LOCALE', d, True) == '1'):
331 bb.debug(1, "package requested not splitting locales") 343 bb.debug(1, "package requested not splitting locales")
@@ -773,6 +785,8 @@ python emit_pkgdata() {
773 write_if_exists(sf, pkg, 'PN') 785 write_if_exists(sf, pkg, 'PN')
774 write_if_exists(sf, pkg, 'PV') 786 write_if_exists(sf, pkg, 'PV')
775 write_if_exists(sf, pkg, 'PR') 787 write_if_exists(sf, pkg, 'PR')
788 write_if_exists(sf, pkg, 'PKGV')
789 write_if_exists(sf, pkg, 'PKGR')
776 write_if_exists(sf, pkg, 'DESCRIPTION') 790 write_if_exists(sf, pkg, 'DESCRIPTION')
777 write_if_exists(sf, pkg, 'SUMMARY') 791 write_if_exists(sf, pkg, 'SUMMARY')
778 write_if_exists(sf, pkg, 'RDEPENDS') 792 write_if_exists(sf, pkg, 'RDEPENDS')
@@ -911,9 +925,9 @@ python package_do_shlibs() {
911 925
912 workdir = bb.data.getVar('WORKDIR', d, True) 926 workdir = bb.data.getVar('WORKDIR', d, True)
913 927
914 ver = bb.data.getVar('PV', d, True) 928 ver = bb.data.getVar('PKGV', d, True)
915 if not ver: 929 if not ver:
916 bb.error("PV not defined") 930 bb.error("PKGV not defined")
917 return 931 return
918 932
919 pkgdest = bb.data.getVar('PKGDEST', d, True) 933 pkgdest = bb.data.getVar('PKGDEST', d, True)
@@ -1025,6 +1039,12 @@ python package_do_shlibs() {
1025 needs_ldconfig = False 1039 needs_ldconfig = False
1026 bb.debug(2, "calculating shlib provides for %s" % pkg) 1040 bb.debug(2, "calculating shlib provides for %s" % pkg)
1027 1041
1042 pkgver = bb.data.getVar('PKGV_' + pkg, d, True)
1043 if not pkgver:
1044 pkgver = bb.data.getVar('PV_' + pkg, d, True)
1045 if not pkgver:
1046 pkgver = ver
1047
1028 needed[pkg] = [] 1048 needed[pkg] = []
1029 sonames = list() 1049 sonames = list()
1030 renames = list() 1050 renames = list()
@@ -1048,10 +1068,10 @@ python package_do_shlibs() {
1048 fd = open(shlibs_file, 'w') 1068 fd = open(shlibs_file, 'w')
1049 for s in sonames: 1069 for s in sonames:
1050 fd.write(s + '\n') 1070 fd.write(s + '\n')
1051 shlib_provider[s] = (pkg, ver) 1071 shlib_provider[s] = (pkg, pkgver)
1052 fd.close() 1072 fd.close()
1053 fd = open(shver_file, 'w') 1073 fd = open(shver_file, 'w')
1054 fd.write(ver + '\n') 1074 fd.write(pkgver + '\n')
1055 fd.close() 1075 fd.close()
1056 if needs_ldconfig and use_ldconfig: 1076 if needs_ldconfig and use_ldconfig:
1057 bb.debug(1, 'adding ldconfig call to postinst for %s' % pkg) 1077 bb.debug(1, 'adding ldconfig call to postinst for %s' % pkg)
@@ -1348,7 +1368,8 @@ python package_depchains() {
1348} 1368}
1349 1369
1350PACKAGE_PREPROCESS_FUNCS ?= "" 1370PACKAGE_PREPROCESS_FUNCS ?= ""
1351PACKAGEFUNCS ?= "perform_packagecopy \ 1371PACKAGEFUNCS ?= "package_get_auto_pr \
1372 perform_packagecopy \
1352 ${PACKAGE_PREPROCESS_FUNCS} \ 1373 ${PACKAGE_PREPROCESS_FUNCS} \
1353 package_do_split_locales \ 1374 package_do_split_locales \
1354 split_and_strip_files \ 1375 split_and_strip_files \