summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Hatle <mark.hatle@windriver.com>2012-05-18 17:18:19 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-05-18 15:25:13 +0100
commitf24d8df3af52e2a2911233746ad69f8899bbdf93 (patch)
treee9d83bc8593fb0fa8bd9b2c6206c7b08efafcc76
parent6d40b658f42837f4270f1dd3c0f350eb84b369f0 (diff)
downloadpoky-f24d8df3af52e2a2911233746ad69f8899bbdf93.tar.gz
sstate.bbclass: Make sure we don't have an empty fixmepath file
Jason Wessel noticed that a package without any fixmepath entries would generate a sed warning about no input files. This patch resolves that by ensuring that an empty fixmepath file never gets written into the sstate archive. Also we avoid a second message by only doing xargs if we got input. (From OE-Core rev: 326563d5a897ae2dba7cfd8d73579d3d979d72c8) Signed-off-by: Mark Hatle <mark.hatle@windriver.com> Signed-off-by: Jason Wessel <jason.wessel@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/sstate.bbclass17
1 files changed, 12 insertions, 5 deletions
diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass
index ccef4a9e39..ae019379bd 100644
--- a/meta/classes/sstate.bbclass
+++ b/meta/classes/sstate.bbclass
@@ -330,20 +330,27 @@ def sstate_hardcode_path(d):
330 sstate_grep_cmd = "grep -l -e '%s'" % (staging_host) 330 sstate_grep_cmd = "grep -l -e '%s'" % (staging_host)
331 sstate_sed_cmd = "sed -i -e 's:%s:FIXMESTAGINGDIRHOST:g'" % (staging_host) 331 sstate_sed_cmd = "sed -i -e 's:%s:FIXMESTAGINGDIRHOST:g'" % (staging_host)
332 332
333 fixmefn = sstate_builddir + "fixmepath"
334
333 sstate_scan_cmd = d.getVar('SSTATE_SCAN_CMD', True) 335 sstate_scan_cmd = d.getVar('SSTATE_SCAN_CMD', True)
334 sstate_filelist_cmd = "tee %sfixmepath" % (sstate_builddir) 336 sstate_filelist_cmd = "tee %s" % (fixmefn)
335 337
336 # fixmepath file needs relative paths, drop sstate_builddir prefix 338 # fixmepath file needs relative paths, drop sstate_builddir prefix
337 sstate_filelist_relative_cmd = "sed -i -e 's:^%s::g' %sfixmepath" % (sstate_builddir, sstate_builddir) 339 sstate_filelist_relative_cmd = "sed -i -e 's:^%s::g' %s" % (sstate_builddir, fixmefn)
338 340
339 # Limit the fixpaths and sed operations based on the initial grep search 341 # Limit the fixpaths and sed operations based on the initial grep search
340 # This has the side effect of making sure the vfs cache is hot 342 # This has the side effect of making sure the vfs cache is hot
341 sstate_hardcode_cmd = "%s | xargs %s | %s | xargs %s" % (sstate_scan_cmd, sstate_grep_cmd, sstate_filelist_cmd, sstate_sed_cmd) 343 sstate_hardcode_cmd = "%s | xargs %s | %s | xargs --no-run-if-empty %s" % (sstate_scan_cmd, sstate_grep_cmd, sstate_filelist_cmd, sstate_sed_cmd)
342 344
343 print "Removing hardcoded paths from sstate package: '%s'" % (sstate_hardcode_cmd) 345 print "Removing hardcoded paths from sstate package: '%s'" % (sstate_hardcode_cmd)
344 os.system(sstate_hardcode_cmd) 346 os.system(sstate_hardcode_cmd)
345 print "Replacing absolute paths in fixmepath file: '%s'" % (sstate_filelist_relative_cmd) 347
346 os.system(sstate_filelist_relative_cmd) 348 # If the fixmefn is empty, remove it..
349 if os.stat(fixmefn).st_size == 0:
350 os.remove(fixmefn)
351 else:
352 print "Replacing absolute paths in fixmepath file: '%s'" % (sstate_filelist_relative_cmd)
353 os.system(sstate_filelist_relative_cmd)
347 354
348def sstate_package(ss, d): 355def sstate_package(ss, d):
349 import oe.path 356 import oe.path