All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: Paul Eggleton <paul.eggleton@linux.intel.com>,
	bitbake-devel@lists.openembedded.org
Subject: Re: [PATCH 1/1] lib/bb/checksum: avoid exception on broken symlinks
Date: Tue, 26 Jul 2016 08:08:42 +0100	[thread overview]
Message-ID: <1469516922.23580.92.camel@linuxfoundation.org> (raw)
In-Reply-To: <c6d59200973e19d358a2fa1a1e5bec4523894e69.1469504165.git.paul.eggleton@linux.intel.com>

On Tue, 2016-07-26 at 15:36 +1200, Paul Eggleton wrote:
> If using OE's externalsrc with a source tree that is not tracked by
> git
> and contains broken symlinks, you can receive "TypeError: unorderable
> types: NoneType() < str()" within the file checksum code due to:
> 
>  checksums.sort(key=operator.itemgetter(1))
> 
> Don't add files with no checksum to the checksums list in order to
> avoid
> this.

In some of the cache code we have to note whether files were checked
for but didn't exist. This means that if they then do exist in a later
run, we know to invalidate the cache.

Does this change break that?

Cheers,

Richard

> Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
> ---
>  lib/bb/checksum.py | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/lib/bb/checksum.py b/lib/bb/checksum.py
> index be4ab68..8428920 100644
> --- a/lib/bb/checksum.py
> +++ b/lib/bb/checksum.py
> @@ -120,13 +120,15 @@ class FileChecksumCache(MultiProcessCache):
>                              checksums.extend(checksum_dir(f))
>                      else:
>                          checksum = checksum_file(f)
> -                        checksums.append((f, checksum))
> +                        if checksum:
> +                            checksums.append((f, checksum))
>              elif os.path.isdir(pth):
>                  if not os.path.islink(pth):
>                      checksums.extend(checksum_dir(pth))
>              else:
>                  checksum = checksum_file(pth)
> -                checksums.append((pth, checksum))
> +                if checksum:
> +                    checksums.append((pth, checksum))
>  
>          checksums.sort(key=operator.itemgetter(1))
>          return checksums
> -- 
> 2.5.5
> 


  reply	other threads:[~2016-07-26  7:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-26  3:36 [PATCH 0/1] Fix file checksum failure with broken symlinks Paul Eggleton
2016-07-26  3:36 ` [PATCH 1/1] lib/bb/checksum: avoid exception on " Paul Eggleton
2016-07-26  7:08   ` Richard Purdie [this message]
2016-07-27 20:53     ` Paul Eggleton
2016-07-27 20:55       ` Paul Eggleton

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=1469516922.23580.92.camel@linuxfoundation.org \
    --to=richard.purdie@linuxfoundation.org \
    --cc=bitbake-devel@lists.openembedded.org \
    --cc=paul.eggleton@linux.intel.com \
    /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.