<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>771</bug_id>
          
          <creation_ts>2011-02-24 21:08:50 +0000</creation_ts>
          <short_desc>Unrecoverable failure if Poky tree is not writeable</short_desc>
          <delta_ts>2011-02-25 09:25:56 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>Meta-yocto</product>
          <component>meta-yocto</component>
          <version>unspecified</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>High</priority>
          <bug_severity>major</bug_severity>
          <target_milestone>1.0 M4</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Gary Thomas">gary</reporter>
          <assigned_to name="Richard Purdie">richard.purdie</assigned_to>
          <cc>poky.bs.watcher</cc>
    
    <cc>poky.watcher</cc>
    
    <cc>sgw</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>---</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>12103</commentid>
    <comment_count>0</comment_count>
    <who name="Gary Thomas">gary</who>
    <bug_when>2011-02-24 21:08:50 +0000</bug_when>
    <thetext>My Poky source tree is in /opt/amltd/poky and is not other/world writeable.
I get this error:
| ERROR: Error executing a python function in /opt/amltd/poky/meta-xyz/packages/images/xyz-server-image.bb:
| OSError: [Errno 1] Operation not permitted: &apos;/opt/amltd/poky/LICENSE&apos;
| 
| ERROR: The stack trace of python calls that resulted in this exception/failure was:
| ERROR:   File &quot;do_populate_lic&quot;, line 78, in &lt;module&gt;
| ERROR:
| ERROR:   File &quot;do_populate_lic&quot;, line 34, in do_populate_lic
| ERROR:
| ERROR:   File &quot;/opt/amltd/poky/bitbake/lib/bb/__init__.py&quot;, line 114, in newFunc
| ERROR:     return func(*args, **kwargs)
| ERROR:
| ERROR:   File &quot;/opt/amltd/poky/bitbake/lib/bb/utils.py&quot;, line 773, in copyfile
| ERROR:     os.chmod(src, stat.S_IRUSR) # Make sure we can read it
| ERROR:
| ERROR: The code that was being executed was:
| ERROR:      0074:            bb.warn(&quot;This could be either because we do not have a generic for this license or the LICENSE field is incorrect&quot;)
| ERROR:      0075:            pass
| ERROR:      0076:
| ERROR:      0077:
| ERROR:  *** 0078:do_populate_lic(d)
| ERROR:      0079:
| ERROR: (file: &apos;do_populate_lic&apos;, lineno: 78, function: &lt;module&gt;)
| ERROR:      0030:    for url in lic_files.split():
| ERROR:      0031:        (type, host, path, user, pswd, parm) = bb.decodeurl(url)
| ERROR:      0032:        # We want the license file to be copied into the destination
| ERROR:      0033:        srclicfile = os.path.join(srcdir, path)
| ERROR:  *** 0034:        ret = bb.copyfile(srclicfile, os.path.join(destdir, os.path.basename(path)))
| ERROR:      0035:        # If the copy didn&apos;t occur, something horrible went wrong and we fail out
| ERROR:      0036:        if ret is False or ret == 0:
| ERROR:      0037:            bb.warn(&quot;%s could not be copied for some reason. It may not exist. WARN for now.&quot; % srclicfile)
| ERROR:      0038:
| ERROR: (file: &apos;do_populate_lic&apos;, lineno: 34, function: do_populate_lic)
| ERROR: Function &apos;do_populate_lic&apos; failed

The image recipe has this line:
  LIC_FILES_CHKSUM = &quot;file://${POKYBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58 &quot;
indicating I want to use just the generic license.

My Poky source tree looks like this:
$ ls -l /opt/amltd/poky/
total 52
drwxrwxr-x  6 root root 4096 Feb  5 13:04 bitbake
drwxrwxr-x  8 root root 4096 Feb  5 13:04 documentation
drwxrwxr-x  3 root root 4096 Oct 22 23:39 handbook
-rw-rw-r--  1 root root  545 Aug 18  2010 LICENSE
drwxrwxr-x 20 root root 4096 Feb  5 13:04 meta
drwxrwxr-x  4 root root 4096 Oct 27 13:33 meta-amltd
drwxrwxr-x  4 root root 4096 Feb  1 21:50 meta-efacec
drwxrwxr-x  4 root root 4096 Feb  5 13:04 meta-oe
drwxrwxr-x  4 root root 4096 Oct 12 21:34 meta-oe_extra
-rwxrwxr-x  1 root root 1493 Feb  5 13:04 poky-init-build-env
-rw-rw-r--  1 root root  636 Aug 18  2010 README
drwxrwxr-x  5 root root 4096 Feb 23 23:46 scripts
drwxrwxr-x  2 root root 4096 Feb 24 01:27 sources

I think this condition should only be a warning as it clearly is under other circumstances which print messages like:
WARNING: zip: Something went wrong with copying: Info-ZIP to /opt/amltd/poky/meta/files/common-licenses
WARNING: This could be either because we do not have a generic for this license or the LICENSE field is incorrect</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>12115</commentid>
    <comment_count>1</comment_count>
      <attachid>96</attachid>
    <who name="Gary Thomas">gary</who>
    <bug_when>2011-02-25 04:40:18 +0000</bug_when>
    <thetext>Created attachment 96
Better error handling in bb.copyfile

If the destination directory is write protected, no actions can be taken on files, hence all operations must be protected from exceptions.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>12132</commentid>
    <comment_count>2</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2011-02-25 09:25:56 +0000</bug_when>
    <thetext>I&apos;ve fixed this in http://git.pokylinux.org/cgit.cgi/poky/commit/?id=9166b9e32fd6f618f9597b07d88cef09a88916a1

I&apos;ve taken a different approach to the attachment since I&apos;d rather just not touch the file at all if we already have read access. If we don&apos;t and its on a readonly filesystem, we&apos;re in trouble regardless.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>96</attachid>
            <date>2011-02-25 04:40:18 +0000</date>
            <delta_ts>2011-02-25 04:40:18 +0000</delta_ts>
            <desc>Better error handling in bb.copyfile</desc>
            <filename>bb-copyfile.patch</filename>
            <type>text/plain</type>
            <size>1175</size>
            <attacher name="Gary Thomas">gary</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL2JpdGJha2UvbGliL2JiL3V0aWxzLnB5IGIvYml0YmFrZS9saWIvYmIvdXRp
bHMucHkKaW5kZXggYjJmOGJiNi4uMzA0MTliZiAxMDA2NDQKLS0tIGEvYml0YmFrZS9saWIvYmIv
dXRpbHMucHkKKysrIGIvYml0YmFrZS9saWIvYmIvdXRpbHMucHkKQEAgLTc3MCwxNiArNzcwLDIw
IEBAIGRlZiBjb3B5ZmlsZShzcmMsIGRlc3QsIG5ld210aW1lID0gTm9uZSwgc3N0YXQgPSBOb25l
KToKICAgICAgICAgICAgIHJldHVybiBGYWxzZQogCiAgICAgaWYgc3RhdC5TX0lTUkVHKHNzdGF0
W3N0YXQuU1RfTU9ERV0pOgotICAgICAgICBvcy5jaG1vZChzcmMsIHN0YXQuU19JUlVTUikgIyBN
YWtlIHN1cmUgd2UgY2FuIHJlYWQgaXQKICAgICAgICAgdHJ5OiAjIEZvciBzYWZldHkgY29weSB0
aGVuIG1vdmUgaXQgb3Zlci4KKyAgICAgICAgICAgIG9zLmNobW9kKHNyYywgc3RhdC5TX0lSVVNS
KSAjIE1ha2Ugc3VyZSB3ZSBjYW4gcmVhZCBpdAogICAgICAgICAgICAgc2h1dGlsLmNvcHlmaWxl
KHNyYywgZGVzdCArICIjbmV3IikKICAgICAgICAgICAgIG9zLnJlbmFtZShkZXN0ICsgIiNuZXci
LCBkZXN0KQogICAgICAgICBleGNlcHQgRXhjZXB0aW9uIGFzIGU6CiAgICAgICAgICAgICBwcmlu
dCgnY29weWZpbGU6IGNvcHknLCBzcmMsICctPicsIGRlc3QsICdmYWlsZWQuJywgZSkKICAgICAg
ICAgICAgIHJldHVybiBGYWxzZQogICAgICAgICBmaW5hbGx5OgotICAgICAgICAgICAgb3MuY2ht
b2Qoc3JjLCBzc3RhdFtzdGF0LlNUX01PREVdKQotICAgICAgICAgICAgb3MudXRpbWUoc3JjLCAo
c3N0YXRbc3RhdC5TVF9BVElNRV0sIHNzdGF0W3N0YXQuU1RfTVRJTUVdKSkKKyAgICAgICAgICAg
ICMgVGhlc2UgbWlnaHQgZmFpbCwgYnV0IG5vIG5lZWQgdG8gcmVwb3J0CisgICAgICAgICAgICB0
cnk6CisgICAgICAgICAgICAgICAgb3MuY2htb2Qoc3JjLCBzc3RhdFtzdGF0LlNUX01PREVdKQor
ICAgICAgICAgICAgICAgIG9zLnV0aW1lKHNyYywgKHNzdGF0W3N0YXQuU1RfQVRJTUVdLCBzc3Rh
dFtzdGF0LlNUX01USU1FXSkpCisgICAgICAgICAgICBleGNlcHQ6CisgICAgICAgICAgICAgICAg
cGFzcwogCiAgICAgZWxzZToKICAgICAgICAgI3dlIGRvbid0IHlldCBoYW5kbGUgc3BlY2lhbCwg
c28gd2UgbmVlZCB0byBmYWxsIGJhY2sgdG8gL2Jpbi9tdgo=
</data>

          </attachment>
      

    </bug>

</bugzilla>