summaryrefslogtreecommitdiffstats
path: root/meta/classes/sstate.bbclass
diff options
context:
space:
mode:
authorRichard Purdie <rpurdie@linux.intel.com>2010-09-29 11:02:07 +0100
committerRichard Purdie <rpurdie@linux.intel.com>2010-09-29 12:12:26 +0100
commitdd28a9c516017cf34c88d491875a61dfaf502d4c (patch)
tree06e3bb508ff1734f269cc9f710abeb969c632146 /meta/classes/sstate.bbclass
parent7087fb788ac1b27109a93a1efd6426fa7a11005d (diff)
downloadpoky-dd28a9c516017cf34c88d491875a61dfaf502d4c.tar.gz
sstate.bbclass: pstage -> sstate name changes (no global implications)
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'meta/classes/sstate.bbclass')
-rw-r--r--meta/classes/sstate.bbclass58
1 files changed, 29 insertions, 29 deletions
diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass
index bd89045cbc..d4e9965369 100644
--- a/meta/classes/sstate.bbclass
+++ b/meta/classes/sstate.bbclass
@@ -120,41 +120,41 @@ def sstate_install(ss, d):
120def sstate_installpkg(ss, d): 120def 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 sstateinst = bb.data.expand("${WORKDIR}/sstate-install-%s/" % ss['name'], d)
124 pstagepkg = bb.data.getVar('SSTATE_PKG', d, True) + '_' + ss['name'] + ".tgz" 124 sstatepkg = 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(sstatepkg):
127 pstaging_fetch(pstagepkg, d) 127 pstaging_fetch(sstatepkg, d)
128 128
129 if not os.path.isfile(pstagepkg): 129 if not os.path.isfile(sstatepkg):
130 bb.note("Staging package %s does not exist" % pstagepkg) 130 bb.note("Staging package %s does not exist" % sstatepkg)
131 return False 131 return False
132 132
133 sstate_clean(ss, d) 133 sstate_clean(ss, d)
134 134
135 bb.data.setVar('SSTATE_INSTDIR', pstageinst, d) 135 bb.data.setVar('SSTATE_INSTDIR', sstateinst, d)
136 bb.data.setVar('SSTATE_PKG', pstagepkg, d) 136 bb.data.setVar('SSTATE_PKG', sstatepkg, 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
140 fixmefn = pstageinst + "fixmepath" 140 fixmefn = sstateinst + "fixmepath"
141 if os.path.isfile(fixmefn): 141 if os.path.isfile(fixmefn):
142 staging = bb.data.getVar('STAGING_DIR', d, True) 142 staging = bb.data.getVar('STAGING_DIR', d, True)
143 fixmefd = open(fixmefn, "r") 143 fixmefd = open(fixmefn, "r")
144 fixmefiles = fixmefd.readlines() 144 fixmefiles = fixmefd.readlines()
145 fixmefd.close() 145 fixmefd.close()
146 for file in fixmefiles: 146 for file in fixmefiles:
147 os.system("sed -i -e s:FIXMESTAGINGDIR:%s:g %s" % (staging, pstageinst + file)) 147 os.system("sed -i -e s:FIXMESTAGINGDIR:%s:g %s" % (staging, sstateinst + file))
148 148
149 for state in ss['dirs']: 149 for state in ss['dirs']:
150 if os.path.exists(state[1]): 150 if os.path.exists(state[1]):
151 oe.path.remove(state[1]) 151 oe.path.remove(state[1])
152 oe.path.copytree(pstageinst + state[0], state[1]) 152 oe.path.copytree(sstateinst + state[0], state[1])
153 sstate_install(ss, d) 153 sstate_install(ss, d)
154 154
155 for plain in ss['plaindirs']: 155 for plain in ss['plaindirs']:
156 bb.mkdirhier(pstageinst + plain) 156 bb.mkdirhier(sstateinst + plain)
157 oe.path.copytree(pstageinst + plain, bb.data.getVar('WORKDIR', d, True) + plain) 157 oe.path.copytree(sstateinst + plain, bb.data.getVar('WORKDIR', d, True) + plain)
158 158
159 return True 159 return True
160 160
@@ -217,48 +217,48 @@ python sstate_cleanall() {
217def sstate_package(ss, d): 217def 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 sstatebuild = bb.data.expand("${WORKDIR}/sstate-build-%s/" % ss['name'], d)
221 pstagepkg = bb.data.getVar('SSTATE_PKG', d, True) + '_'+ ss['name'] + ".tgz" 221 sstatepkg = bb.data.getVar('SSTATE_PKG', d, True) + '_'+ ss['name'] + ".tgz"
222 bb.mkdirhier(pstagebuild) 222 bb.mkdirhier(sstatebuild)
223 bb.mkdirhier(os.path.dirname(pstagepkg)) 223 bb.mkdirhier(os.path.dirname(sstatepkg))
224 for state in ss['dirs']: 224 for state in ss['dirs']:
225 srcbase = state[0].rstrip("/").rsplit('/', 1)[0] 225 srcbase = state[0].rstrip("/").rsplit('/', 1)[0]
226 oe.path.copytree(state[1], pstagebuild + state[0]) 226 oe.path.copytree(state[1], sstatebuild + state[0])
227 for walkroot, dirs, files in os.walk(state[1]): 227 for walkroot, dirs, files in os.walk(state[1]):
228 for file in files: 228 for file in files:
229 srcpath = os.path.join(walkroot, file) 229 srcpath = os.path.join(walkroot, file)
230 dstpath = srcpath.replace(state[1], pstagebuild + state[0]) 230 dstpath = srcpath.replace(state[1], sstatebuild + state[0])
231 bb.debug(2, "Preparing %s for packaging at %s" % (srcpath, dstpath)) 231 bb.debug(2, "Preparing %s for packaging at %s" % (srcpath, dstpath))
232 232
233 workdir = bb.data.getVar('WORKDIR', d, True) 233 workdir = bb.data.getVar('WORKDIR', d, True)
234 for plain in ss['plaindirs']: 234 for plain in ss['plaindirs']:
235 pdir = plain.replace(workdir, pstagebuild) 235 pdir = plain.replace(workdir, sstatebuild)
236 bb.mkdirhier(plain) 236 bb.mkdirhier(plain)
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('SSTATE_BUILDDIR', pstagebuild, d) 240 bb.data.setVar('SSTATE_BUILDDIR', sstatebuild, d)
241 bb.data.setVar('SSTATE_PKG', pstagepkg, d) 241 bb.data.setVar('SSTATE_PKG', sstatepkg, 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(sstatepkg + ".siginfo", d)
245 245
246 return 246 return
247 247
248def pstaging_fetch(pstagepkg, d): 248def pstaging_fetch(sstatepkg, d):
249 import bb.fetch 249 import bb.fetch
250 250
251 # only try and fetch if the user has configured a mirror 251 # only try and fetch if the user has configured a mirror
252 if bb.data.getVar('PSTAGE_MIRROR', d) != "": 252 if bb.data.getVar('PSTAGE_MIRROR', d) != "":
253 # Copy the data object and override DL_DIR and SRC_URI 253 # Copy the data object and override DL_DIR and SRC_URI
254 pd = d.createCopy() 254 pd = d.createCopy()
255 dldir = bb.data.expand("${PSTAGE_DIR}/${PSTAGE_PKGPATH}", pd) 255 dldir = bb.data.expand("${PSTAGE_DIR}/${SSTATE_PKGPATH}", pd)
256 mirror = bb.data.expand("${PSTAGE_MIRROR}/${PSTAGE_PKGPATH}/", pd) 256 mirror = bb.data.expand("${PSTAGE_MIRROR}/${SSTATE_PKGPATH}/", pd)
257 srcuri = mirror + os.path.basename(pstagepkg) 257 srcuri = mirror + os.path.basename(sstatepkg)
258 bb.data.setVar('DL_DIR', dldir, pd) 258 bb.data.setVar('DL_DIR', dldir, pd)
259 bb.data.setVar('SRC_URI', srcuri, pd) 259 bb.data.setVar('SRC_URI', srcuri, pd)
260 260
261 # Try a fetch from the pstage mirror, if it fails just return and 261 # Try a fetch from the sstate mirror, if it fails just return and
262 # we will build the package 262 # we will build the package
263 try: 263 try:
264 bb.fetch.init([srcuri], pd) 264 bb.fetch.init([srcuri], pd)
@@ -287,7 +287,7 @@ python sstate_task_postfunc () {
287 287
288 288
289# 289#
290# Shell function to generate a pstage package from a directory 290# Shell function to generate a sstate package from a directory
291# set as SSTATE_BUILDDIR 291# set as SSTATE_BUILDDIR
292# 292#
293sstate_create_package () { 293sstate_create_package () {