summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <rpurdie@linux.intel.com>2010-09-29 10:57:16 +0100
committerRichard Purdie <rpurdie@linux.intel.com>2010-09-29 12:12:26 +0100
commit7087fb788ac1b27109a93a1efd6426fa7a11005d (patch)
tree80548f29b7ed18c96e61a634011212fe5949119d
parent9747616600b424e8c0d7075a9b516a12d65a17c3 (diff)
downloadpoky-7087fb788ac1b27109a93a1efd6426fa7a11005d.tar.gz
sstate.bbclass: Rename PSTAGE2 -> SSTATE
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
-rw-r--r--meta/classes/sstate.bbclass70
1 files changed, 35 insertions, 35 deletions
diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass
index 38762359eb..bd89045cbc 100644
--- a/meta/classes/sstate.bbclass
+++ b/meta/classes/sstate.bbclass
@@ -1,33 +1,33 @@
1PSTAGE2_MANIFESTS = "${TMPDIR}/pstagelogs" 1SSTATE_MANIFESTS = "${TMPDIR}/pstagelogs"
2PSTAGE2_MANFILEPREFIX = "${PSTAGE2_MANIFESTS}/manifest-${PSTAGE2_PKGARCH}-${PN}" 2SSTATE_MANFILEPREFIX = "${SSTATE_MANIFESTS}/manifest-${SSTATE_PKGARCH}-${PN}"
3 3
4 4
5PSTAGE2_PKGARCH = "${BASE_PACKAGE_ARCH}" 5SSTATE_PKGARCH = "${BASE_PACKAGE_ARCH}"
6PSTAGE2_PKGVERSION = "${PV}-${PR}" 6SSTATE_PKGVERSION = "${PV}-${PR}"
7PSTAGE2_PKGPN = "${@bb.data.expand('staging-${PN}-${MULTIMACH_ARCH}${TARGET_VENDOR}-${TARGET_OS}', d).replace('_', '-')}" 7SSTATE_PKGPN = "${@bb.data.expand('staging-${PN}-${MULTIMACH_ARCH}${TARGET_VENDOR}-${TARGET_OS}', d).replace('_', '-')}"
8 8
9PSTAGE2_PKGNAME = "${PSTAGE2_PKGPN}_${PSTAGE2_PKGVERSION}_${PSTAGE2_PKGARCH}" 9SSTATE_PKGNAME = "${SSTATE_PKGPN}_${SSTATE_PKGVERSION}_${SSTATE_PKGARCH}"
10PSTAGE2_EXTRAPATH ?= "" 10SSTATE_EXTRAPATH ?= ""
11PSTAGE2_PKGPATH = "${DISTRO}/${OELAYOUT_ABI}${PSTAGE2_EXTRAPATH}" 11SSTATE_PKGPATH = "${DISTRO}/${OELAYOUT_ABI}${SSTATE_EXTRAPATH}"
12PSTAGE2_PKG = "${PSTAGE_DIR}2/${PSTAGE2_PKGPATH}/${PSTAGE2_PKGNAME}" 12SSTATE_PKG = "${PSTAGE_DIR}2/${SSTATE_PKGPATH}/${SSTATE_PKGNAME}"
13 13
14PSTAGE2_SCAN_CMD ?= "find ${PSTAGE2_BUILDDIR} \( -name "*.la" -o -name "*-config" \) -type f" 14SSTATE_SCAN_CMD ?= "find ${SSTATE_BUILDDIR} \( -name "*.la" -o -name "*-config" \) -type f"
15 15
16python () { 16python () {
17 if bb.data.inherits_class('native', d): 17 if bb.data.inherits_class('native', d):
18 bb.data.setVar('PSTAGE2_PKGARCH', bb.data.getVar('BUILD_ARCH', d), d) 18 bb.data.setVar('SSTATE_PKGARCH', bb.data.getVar('BUILD_ARCH', d), d)
19 elif bb.data.inherits_class('cross', d) or bb.data.inherits_class('crosssdk', d): 19 elif bb.data.inherits_class('cross', d) or bb.data.inherits_class('crosssdk', d):
20 bb.data.setVar('PSTAGE2_PKGARCH', bb.data.expand("${BUILD_ARCH}_${BASE_PACKAGE_ARCH}", d), d) 20 bb.data.setVar('SSTATE_PKGARCH', bb.data.expand("${BUILD_ARCH}_${BASE_PACKAGE_ARCH}", d), d)
21 elif bb.data.inherits_class('nativesdk', d): 21 elif bb.data.inherits_class('nativesdk', d):
22 bb.data.setVar('PSTAGE2_PKGARCH', bb.data.expand("${SDK_ARCH}", d), d) 22 bb.data.setVar('SSTATE_PKGARCH', bb.data.expand("${SDK_ARCH}", d), d)
23 elif bb.data.inherits_class('cross-canadian', d): 23 elif bb.data.inherits_class('cross-canadian', d):
24 bb.data.setVar('PSTAGE2_PKGARCH', bb.data.expand("${SDK_ARCH}_${BASE_PACKAGE_ARCH}", d), d) 24 bb.data.setVar('SSTATE_PKGARCH', bb.data.expand("${SDK_ARCH}_${BASE_PACKAGE_ARCH}", d), d)
25 25
26 # These classes encode staging paths into their scripts data so can only be 26 # These classes encode staging paths into their scripts data so can only be
27 # reused if we manipulate the paths 27 # reused if we manipulate the paths
28 if bb.data.inherits_class('native', d) or bb.data.inherits_class('cross', d) or bb.data.inherits_class('sdk', d) or bb.data.inherits_class('crosssdk', d): 28 if bb.data.inherits_class('native', d) or bb.data.inherits_class('cross', d) or bb.data.inherits_class('sdk', d) or bb.data.inherits_class('crosssdk', d):
29 scan_cmd = "grep -Irl ${STAGING_DIR} ${PSTAGE2_BUILDDIR}" 29 scan_cmd = "grep -Irl ${STAGING_DIR} ${SSTATE_BUILDDIR}"
30 bb.data.setVar('PSTAGE2_SCAN_CMD', scan_cmd, d) 30 bb.data.setVar('SSTATE_SCAN_CMD', scan_cmd, d)
31 31
32 for task in (bb.data.getVar('SSTATETASKS', d, True) or "").split(): 32 for task in (bb.data.getVar('SSTATETASKS', d, True) or "").split():
33 funcs = bb.data.getVarFlag(task, 'prefuncs', d) or "" 33 funcs = bb.data.getVarFlag(task, 'prefuncs', d) or ""
@@ -79,8 +79,8 @@ def sstate_install(ss, d):
79 79
80 sharedfiles = [] 80 sharedfiles = []
81 shareddirs = [] 81 shareddirs = []
82 bb.mkdirhier(bb.data.expand("${PSTAGE2_MANIFESTS}", d)) 82 bb.mkdirhier(bb.data.expand("${SSTATE_MANIFESTS}", d))
83 manifest = bb.data.expand("${PSTAGE2_MANFILEPREFIX}.%s" % ss['name'], d) 83 manifest = bb.data.expand("${SSTATE_MANFILEPREFIX}.%s" % ss['name'], d)
84 84
85 if os.access(manifest, os.R_OK): 85 if os.access(manifest, os.R_OK):
86 bb.fatal("Package already staged (%s)?!" % manifest) 86 bb.fatal("Package already staged (%s)?!" % manifest)
@@ -121,7 +121,7 @@ def sstate_installpkg(ss, d):
121 import oe.path 121 import oe.path
122 122
123 pstageinst = bb.data.expand("${WORKDIR}/pstage-install-%s/" % ss['name'], d) 123 pstageinst = bb.data.expand("${WORKDIR}/pstage-install-%s/" % ss['name'], d)
124 pstagepkg = bb.data.getVar('PSTAGE2_PKG', d, True) + '_' + ss['name'] + ".tgz" 124 pstagepkg = bb.data.getVar('SSTATE_PKG', d, True) + '_' + ss['name'] + ".tgz"
125 125
126 if not os.path.exists(pstagepkg): 126 if not os.path.exists(pstagepkg):
127 pstaging_fetch(pstagepkg, d) 127 pstaging_fetch(pstagepkg, d)
@@ -132,8 +132,8 @@ def sstate_installpkg(ss, d):
132 132
133 sstate_clean(ss, d) 133 sstate_clean(ss, d)
134 134
135 bb.data.setVar('PSTAGE2_INSTDIR', pstageinst, d) 135 bb.data.setVar('SSTATE_INSTDIR', pstageinst, d)
136 bb.data.setVar('PSTAGE2_PKG', pstagepkg, d) 136 bb.data.setVar('SSTATE_PKG', pstagepkg, d)
137 bb.build.exec_func('sstate_unpack_package', d) 137 bb.build.exec_func('sstate_unpack_package', d)
138 138
139 # Fixup hardcoded paths 139 # Fixup hardcoded paths
@@ -183,7 +183,7 @@ def sstate_clean_manifest(manifest, d):
183 183
184def sstate_clean(ss, d): 184def sstate_clean(ss, d):
185 185
186 manifest = bb.data.expand("${PSTAGE2_MANFILEPREFIX}.%s" % ss['name'], d) 186 manifest = bb.data.expand("${SSTATE_MANFILEPREFIX}.%s" % ss['name'], d)
187 187
188 locks = [] 188 locks = []
189 for lock in ss['lockfiles']: 189 for lock in ss['lockfiles']:
@@ -202,8 +202,8 @@ python sstate_cleanall() {
202 202
203 bb.note("Removing shared state for package %s" % bb.data.getVar('PN', d, True)) 203 bb.note("Removing shared state for package %s" % bb.data.getVar('PN', d, True))
204 204
205 manifest_dir = bb.data.getVar('PSTAGE2_MANIFESTS', d, True) 205 manifest_dir = bb.data.getVar('SSTATE_MANIFESTS', d, True)
206 manifest_prefix = bb.data.getVar("PSTAGE2_MANFILEPREFIX", d, True) 206 manifest_prefix = bb.data.getVar("SSTATE_MANFILEPREFIX", d, True)
207 manifest_pattern = os.path.basename(manifest_prefix) + ".*" 207 manifest_pattern = os.path.basename(manifest_prefix) + ".*"
208 208
209 if not os.path.exists(manifest_dir): 209 if not os.path.exists(manifest_dir):
@@ -218,7 +218,7 @@ def sstate_package(ss, d):
218 import oe.path 218 import oe.path
219 219
220 pstagebuild = bb.data.expand("${WORKDIR}/pstage-build-%s/" % ss['name'], d) 220 pstagebuild = bb.data.expand("${WORKDIR}/pstage-build-%s/" % ss['name'], d)
221 pstagepkg = bb.data.getVar('PSTAGE2_PKG', d, True) + '_'+ ss['name'] + ".tgz" 221 pstagepkg = bb.data.getVar('SSTATE_PKG', d, True) + '_'+ ss['name'] + ".tgz"
222 bb.mkdirhier(pstagebuild) 222 bb.mkdirhier(pstagebuild)
223 bb.mkdirhier(os.path.dirname(pstagepkg)) 223 bb.mkdirhier(os.path.dirname(pstagepkg))
224 for state in ss['dirs']: 224 for state in ss['dirs']:
@@ -237,8 +237,8 @@ def sstate_package(ss, d):
237 bb.mkdirhier(pdir) 237 bb.mkdirhier(pdir)
238 oe.path.copytree(plain, pdir) 238 oe.path.copytree(plain, pdir)
239 239
240 bb.data.setVar('PSTAGE2_BUILDDIR', pstagebuild, d) 240 bb.data.setVar('SSTATE_BUILDDIR', pstagebuild, d)
241 bb.data.setVar('PSTAGE2_PKG', pstagepkg, d) 241 bb.data.setVar('SSTATE_PKG', pstagepkg, d)
242 bb.build.exec_func('sstate_create_package', d) 242 bb.build.exec_func('sstate_create_package', d)
243 243
244 bb.siggen.dump_this_task(pstagepkg + ".siginfo", d) 244 bb.siggen.dump_this_task(pstagepkg + ".siginfo", d)
@@ -288,25 +288,25 @@ python sstate_task_postfunc () {
288 288
289# 289#
290# Shell function to generate a pstage package from a directory 290# Shell function to generate a pstage package from a directory
291# set as PSTAGE2_BUILDDIR 291# set as SSTATE_BUILDDIR
292# 292#
293sstate_create_package () { 293sstate_create_package () {
294 # Need to remove hardcoded paths and fix these when we install the 294 # Need to remove hardcoded paths and fix these when we install the
295 # staging packages. 295 # staging packages.
296 for i in `${PSTAGE2_SCAN_CMD}` ; do \ 296 for i in `${SSTATE_SCAN_CMD}` ; do \
297 sed -i -e s:${STAGING_DIR}:FIXMESTAGINGDIR:g $i 297 sed -i -e s:${STAGING_DIR}:FIXMESTAGINGDIR:g $i
298 echo $i | sed -e 's:${PSTAGE2_BUILDDIR}::' >> ${PSTAGE2_BUILDDIR}fixmepath 298 echo $i | sed -e 's:${SSTATE_BUILDDIR}::' >> ${SSTATE_BUILDDIR}fixmepath
299 done 299 done
300 300
301 cd ${PSTAGE2_BUILDDIR} 301 cd ${SSTATE_BUILDDIR}
302 tar -cvzf ${PSTAGE2_PKG} * 302 tar -cvzf ${SSTATE_PKG} *
303} 303}
304 304
305# 305#
306# Shell function to decompress and prepare a package for installation 306# Shell function to decompress and prepare a package for installation
307# 307#
308sstate_unpack_package () { 308sstate_unpack_package () {
309 mkdir -p ${PSTAGE2_INSTDIR} 309 mkdir -p ${SSTATE_INSTDIR}
310 cd ${PSTAGE2_INSTDIR} 310 cd ${SSTATE_INSTDIR}
311 tar -xvzf ${PSTAGE2_PKG} 311 tar -xvzf ${SSTATE_PKG}
312} 312}