Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Paul Eggleton <paul.eggleton@linux.intel.com>
To: openembedded-core@lists.openembedded.org
Subject: [PATCH] psplash: copy image files from workdir instead of next to recipe
Date: Fri, 27 Sep 2013 16:46:06 +0100	[thread overview]
Message-ID: <1380296766-20331-1-git-send-email-paul.eggleton@linux.intel.com> (raw)

During parsing this recipe builds up a list of splash image files,
however it was recording full paths to local files (i.e. the files next
to the recipe) and then in do_compile it was pointing to those instead
of the fetched files in WORKDIR. Fix it to use the fetched files which
has the added benefit of the do_compile signature not changing if the
recipe is moved around.

Fixes [YOCTO #5250].

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
 meta/recipes-core/psplash/psplash_git.bb | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/meta/recipes-core/psplash/psplash_git.bb b/meta/recipes-core/psplash/psplash_git.bb
index 5122d38..1cab296 100644
--- a/meta/recipes-core/psplash/psplash_git.bb
+++ b/meta/recipes-core/psplash/psplash_git.bb
@@ -23,8 +23,8 @@ python __anonymous() {
     haspng = False
     for uri in splashfiles:
         fetcher = bb.fetch2.Fetch([uri], d)
-        flocal = fetcher.localpath(uri)
-        fbase = os.path.splitext(os.path.basename(flocal))[0]
+        flocal = os.path.basename(fetcher.localpath(uri))
+        fbase = os.path.splitext(flocal)[0]
         outsuffix = fetcher.ud[uri].parm.get("outsuffix")
         if not outsuffix:
             if fbase.startswith("psplash-"):
@@ -74,18 +74,19 @@ python do_compile () {
     import shutil
 
     # Build a separate executable for each splash image
+    workdir = d.getVar('WORKDIR', True)
     convertscript = "%s/make-image-header.sh" % d.getVar('S', True)
     destfile = "%s/psplash-poky-img.h" % d.getVar('S', True)
     localfiles = d.getVar('SPLASH_LOCALPATHS', True).split()
     outputfiles = d.getVar('SPLASH_INSTALL', True).split()
     for localfile, outputfile in zip(localfiles, outputfiles):
         if localfile.endswith(".png"):
-            outp = oe.utils.getstatusoutput('%s %s POKY' % (convertscript, localfile))
+            outp = oe.utils.getstatusoutput('%s %s POKY' % (convertscript, os.path.join(workdir, localfile)))
             print(outp[1])
-            fbase = os.path.splitext(os.path.basename(localfile))[0]
+            fbase = os.path.splitext(localfile)[0]
             shutil.copyfile("%s-img.h" % fbase, destfile)
         else:
-            shutil.copyfile(localfile, destfile)
+            shutil.copyfile(os.path.join(workdir, localfile), destfile)
         # For some reason just updating the header is not enough, we have to touch the .c
         # file in order to get it to rebuild
         os.utime("%s/psplash.c" % d.getVar('S', True), None)
-- 
1.8.1.2



                 reply	other threads:[~2013-09-27 15:46 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1380296766-20331-1-git-send-email-paul.eggleton@linux.intel.com \
    --to=paul.eggleton@linux.intel.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox