summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/classes/sstate.bbclass28
1 files changed, 21 insertions, 7 deletions
diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass
index a8c98e5c7f..ad7d121f25 100644
--- a/meta/classes/sstate.bbclass
+++ b/meta/classes/sstate.bbclass
@@ -174,18 +174,29 @@ def sstate_installpkg(ss, d):
174 bb.build.exec_func('sstate_unpack_package', d) 174 bb.build.exec_func('sstate_unpack_package', d)
175 175
176 # Fixup hardcoded paths 176 # Fixup hardcoded paths
177 #
178 # Note: The logic below must match the reverse logic in
179 # sstate_hardcode_path(d)
180
177 fixmefn = sstateinst + "fixmepath" 181 fixmefn = sstateinst + "fixmepath"
178 if os.path.isfile(fixmefn): 182 if os.path.isfile(fixmefn):
179 staging = d.getVar('STAGING_DIR', True) 183 staging = d.getVar('STAGING_DIR', True)
180 staging_target = d.getVar('STAGING_DIR_TARGET', True) 184 staging_target = d.getVar('STAGING_DIR_TARGET', True)
181 staging_host = d.getVar('STAGING_DIR_HOST', True) 185 staging_host = d.getVar('STAGING_DIR_HOST', True)
182 fixmefd = open(fixmefn, "r") 186
183 fixmefiles = fixmefd.readlines() 187 if bb.data.inherits_class('native', d) or bb.data.inherits_class('nativesdk', d) or bb.data.inherits_class('crosssdk', d) or bb.data.inherits_class('cross-canadian', d):
184 fixmefd.close() 188 sstate_sed_cmd = "sed -i -e 's:FIXMESTAGINGDIR:%s:g'" % (staging)
185 for file in fixmefiles: 189 elif bb.data.inherits_class('cross', d):
186 os.system("sed -i -e s:FIXMESTAGINGDIRTARGET:%s:g %s" % (staging_target, sstateinst + file)) 190 sstate_sed_cmd = "sed -i -e 's:FIXMESTAGINGDIRTARGET:%s:g; s:FIXMESTAGINGDIR:%s:g'" % (staging_target, staging)
187 os.system("sed -i -e s:FIXMESTAGINGDIRHOST:%s:g %s" % (staging_host, sstateinst + file)) 191 else:
188 os.system("sed -i -e s:FIXMESTAGINGDIR:%s:g %s" % (staging, sstateinst + file)) 192 sstate_sed_cmd = "sed -i -e 's:FIXMESTAGINGDIRHOST:%s:g'" % (staging_host)
193
194 # Add sstateinst to each filename in fixmepath, use xargs to efficiently call sed
195 sstate_hardcode_cmd = "sed -e 's:^:%s:g' %s | xargs %s" % (sstateinst, fixmefn, sstate_sed_cmd)
196
197 print "Replacing fixme paths in sstate package: %s" % (sstate_hardcode_cmd)
198 os.system(sstate_hardcode_cmd)
199
189 # Need to remove this or we'd copy it into the target directory and may 200 # Need to remove this or we'd copy it into the target directory and may
190 # conflict with another writer 201 # conflict with another writer
191 os.remove(fixmefn) 202 os.remove(fixmefn)
@@ -300,6 +311,9 @@ python sstate_cleanall() {
300def sstate_hardcode_path(d): 311def sstate_hardcode_path(d):
301 # Need to remove hardcoded paths and fix these when we install the 312 # Need to remove hardcoded paths and fix these when we install the
302 # staging packages. 313 # staging packages.
314 #
315 # Note: the logic in this function needs to match the reverse logic
316 # in sstate_installpkg(ss, d)
303 317
304 staging = d.getVar('STAGING_DIR', True) 318 staging = d.getVar('STAGING_DIR', True)
305 staging_target = d.getVar('STAGING_DIR_TARGET', True) 319 staging_target = d.getVar('STAGING_DIR_TARGET', True)