All of lore.kernel.org
 help / color / mirror / Atom feed
From: Saul Wold <sgw@linux.intel.com>
To: Patches and discussions about the oe-core layer
	<openembedded-core@lists.openembedded.org>
Subject: Re: [PATCH] license.bbclass: Check if copyfile succeeded with isfile
Date: Wed, 04 Apr 2012 09:55:08 -0700	[thread overview]
Message-ID: <4F7C7CEC.1060307@linux.intel.com> (raw)
In-Reply-To: <1333451148-32709-1-git-send-email-andrei@gherzan.ro>

On 04/03/2012 04:05 AM, Andrei Gherzan wrote:
> A cleaner way to check if copyfile suceeded is to use os.path.isfile.
> In this way we can omit warns in some python versions where copyfile
> return the same non-0 value even is this action is successfull.
>
> Signed-off-by: Andrei Gherzan<andrei@gherzan.ro>
> ---
>   meta/classes/license.bbclass |    5 +++--
>   1 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/meta/classes/license.bbclass b/meta/classes/license.bbclass
> index c85233c..6c4a673 100644
> --- a/meta/classes/license.bbclass
> +++ b/meta/classes/license.bbclass
> @@ -215,9 +215,10 @@ python do_populate_lic() {
>           if spdx_generic and license_source:
>               # we really should copy to generic_ + spdx_generic, however, that ends up messing the manifest
>               # audit up. This should be fixed in emit_pkgdata (or, we actually got and fix all the recipes)
> -            ret = bb.copyfile(os.path.join(license_source, spdx_generic), os.path.join(os.path.join(d.getVar('LICSSTATEDIR', True), pn), "generic_" + license_type))
> +
> +            bb.copyfile(os.path.join(license_source, spdx_generic), os.path.join(os.path.join(d.getVar('LICSSTATEDIR', True), pn), "generic_" + license_type))
> +            if not os.path.isfile(os.path.join(os.path.join(d.getVar('LICSSTATEDIR', True), pn), "generic_" + license_type)):
>               # If the copy didn't occur, something horrible went wrong and we fail out
> -            if not ret:
>                   bb.warn("%s for %s could not be copied for some reason. It may not exist. WARN for now." % (spdx_generic, pn))
>           else:
>               # And here is where we warn people that their licenses are lousy

Merged into OE-Core

Thanks
	Sau!



      reply	other threads:[~2012-04-04 17:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-03 11:05 [PATCH] license.bbclass: Check if copyfile succeeded with isfile Andrei Gherzan
2012-04-04 16:55 ` Saul Wold [this message]

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=4F7C7CEC.1060307@linux.intel.com \
    --to=sgw@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.