All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joshua Lock <josh@linux.intel.com>
To: openembedded-core@lists.openembedded.org
Subject: Re: [PATCH 5/7] sanity.bbclass: add extra information when SSTATE_CACHE unusable
Date: Wed, 23 May 2012 18:53:55 -0700	[thread overview]
Message-ID: <4FBD94B3.3070304@linux.intel.com> (raw)
In-Reply-To: <3cdd2984697d7068273ebaa3545fa25caf806fb9.1337816265.git.josh@linux.intel.com>



On 23/05/12 17:03, Joshua Lock wrote:
> If the user does not have write permissions to SSTATE_CACHE, detected by
> the check_create_long_filename() test failing with a "Permission denied"
> value in strerror, then suggest they might want to use the location as
> an entry in SSTATE_MIRRORS.
>
> Signed-off-by: Joshua Lock<josh@linux.intel.com>
> ---
>   meta/classes/sanity.bbclass |    3 +++
>   1 files changed, 3 insertions(+), 0 deletions(-)
>
> diff --git a/meta/classes/sanity.bbclass b/meta/classes/sanity.bbclass
> index 39da14b..e86edf7 100644
> --- a/meta/classes/sanity.bbclass
> +++ b/meta/classes/sanity.bbclass
> @@ -100,6 +100,9 @@ def check_sanity_sstate_dir_change(sstate_dir, data):
>       testmsg = ""
>       if sstate_dir != "":
>           testmsg = check_create_long_filename(sstate_dir, "SSTATE_DIR")
> +        # If we don't have permissions to SSTATE_DIR, suggest the user set it as an SSTATE_MIRRORS
> +        if testmsg.split(': ')[1].strip() == "Permission denied.":
> +            testmsg = testmsg + "You could try using %s in SSTATE_MIRRORS rather than as an SSTATE_CACHE.\n" % (sstate_dir)
>       return testmsg

Whoops. This one breaks when check_create_long_filename() succeeds. I've 
updated the git repo with the following hunk instead of above:

+        # If we don't have permissions to SSTATE_DIR, suggest the user 
set it as an SSTATE_MIRRORS
+        try:
+            err = testmsg.split(': ')[1].strip()
+            if err == "Permission denied.":
+                testmsg = testmsg + "You could try using %s in 
SSTATE_MIRRORS rather than as an SSTATE_CACHE.\n" % (sstate_dir)
+        except IndexError:
+            pass

Tested with both an SSTATE_DIR I can write to and one I can't.

Thanks,

Joshua
>
>   def check_sanity_tmpdir_change(tmpdir, data):
-- 
Joshua Lock
         Yocto Project
         Intel Open Source Technology Centre



  reply	other threads:[~2012-05-24  2:04 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-24  0:02 [PATCH 0/7] Sanity class clean ups Joshua Lock
2012-05-24  0:02 ` [PATCH 1/7] Revert "sanity.bbclass: check user can read and write to SSTATE_DIR" Joshua Lock
2012-05-24  0:02 ` [PATCH 2/7] sanity.bbclass: copy the data store and finalise before running checks Joshua Lock
2012-05-24  0:02 ` [PATCH 3/7] sanity.bbclass: data.getVar(VAR, obj, exp) -> obj.getVar(VAR, exp) Joshua Lock
2012-05-24  0:03 ` [PATCH 4/7] sanity.bbclass: add newline to check_create_long_filename failure message Joshua Lock
2012-05-24  0:03 ` [PATCH 5/7] sanity.bbclass: add extra information when SSTATE_CACHE unusable Joshua Lock
2012-05-24  1:53   ` Joshua Lock [this message]
2012-05-24  0:03 ` [PATCH 6/7] sanity.bbclass: catch an extra exception in check_create_long_filename Joshua Lock
2012-05-24  0:03 ` [PATCH 7/7] sanity.bbclass: check sanity at BuildStarted rather than ConfigParsed Joshua Lock
2012-05-24  0:41 ` [PATCH 0/7] Sanity class clean ups Christopher Larson
2012-05-24 18:14 ` Saul Wold

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=4FBD94B3.3070304@linux.intel.com \
    --to=josh@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.