Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Mike Looijmans <mike.looijmans@topic.nl>
To: <openembedded-core@lists.openembedded.org>
Subject: Re: [PATCH] sanity.bbclass: check SSTATE_DIR, DL_DIR and *MIRROR for broken symlinks
Date: Mon, 10 Aug 2015 11:10:58 +0200	[thread overview]
Message-ID: <55C86AA2.2050706@topic.nl> (raw)
In-Reply-To: <20150810081845.GF6102@loska>

On 10-08-15 10:18, Mikko.Rapeli@bmw.de wrote:
> On Fri, Jul 31, 2015 at 12:00:15PM +0300, Mikko Rapeli wrote:
...
>> +# Check that path isn't a broken symlink
>> +def check_symlink(lnk):
>> +    if os.path.islink(lnk) and not os.path.exists(lnk):
>> +       return False
>> +    return True

- Bad coding style "if (x) return false".
- Naming a method "check..." suggests to me that it will raise an exception on 
failure.

alternatives:

def is_broken_symlink(lnk):
     return os.path.islink(lnk) and not os.path.exists(lnk)

def check_symlink(lnk, data):
     if os.path.islink(lnk) and not os.path.exists(lnk):
	raise_sanity_error("%s is a broken symlink." % lnk, data)


Kind regards,

Mike Looijmans
System Expert

TOPIC Embedded Products
Eindhovenseweg 32-C, NL-5683 KH Best
Postbus 440, NL-5680 AK Best
Telefoon: +31 (0) 499 33 69 79
Telefax: +31 (0) 499 33 69 70
E-mail: mike.looijmans@topicproducts.com
Website: www.topicproducts.com

Please consider the environment before printing this e-mail







  reply	other threads:[~2015-08-10  9:11 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-31  9:00 [PATCH] sanity.bbclass: check SSTATE_DIR, DL_DIR and *MIRROR for broken symlinks Mikko Rapeli
2015-08-10  8:18 ` Mikko.Rapeli
2015-08-10  9:10   ` Mike Looijmans [this message]
2015-08-10 11:48     ` Mikko.Rapeli
2015-08-10 14:00       ` [PATCH v2] " Mikko Rapeli
2015-08-10 16:35   ` [PATCH] " Burton, Ross
2015-08-10 17:02     ` Mikko.Rapeli

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=55C86AA2.2050706@topic.nl \
    --to=mike.looijmans@topic.nl \
    --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