<?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>10323</bug_id>
          
          <creation_ts>2016-09-22 20:19:02 +0000</creation_ts>
          <short_desc>Sample script to create source release for specific licences fails</short_desc>
          <delta_ts>2017-03-14 15:58:54 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>9</classification_id>
          <classification>Documentation</classification>
          <product>Development Manual</product>
          <component>development</component>
          <version>2.1.2</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>14 Mar 2017: Marked doc flag to &quot;done&quot;</status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>2.3 M3</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Henry Bruce">henry.bruce</reporter>
          <assigned_to name="Henry Bruce">henry.bruce</assigned_to>
          <cc>bluelightning</cc>
    
    <cc>pidge</cc>
    
    <cc>srifenbark</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>Done (doc changes complete)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>66517</commentid>
    <comment_count>0</comment_count>
    <who name="Henry Bruce">henry.bruce</who>
    <bug_when>2016-09-22 20:19:02 +0000</bug_when>
    <thetext>See http://www.yoctoproject.org/docs/2.1/dev-manual/dev-manual.html#providing-the-source-code

There is a sample script to create a subset of source release tarballs based on licence. 

$ cd poky/build/tmp/deploy/sources
$ mkdir ~/gpl_source_release
$ for dir in */*GPL*; do cp -r $dir ~/gpl_source_release; done

This fails as there are no files matching the regex */*GPL*. Script should be looking for packages with specified licences in tmp/deploy/licences and then using package name to copy folder from tmp/deploy/sources</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>66554</commentid>
    <comment_count>1</comment_count>
    <who name="Scott Rifenbark">srifenbark</who>
    <bug_when>2016-09-23 15:54:56 +0000</bug_when>
    <thetext>Hi, 

Can you put the lines in for the script that would work?  I am not quite sure how they need to be.  

Thanks, 
Scott</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>66560</commentid>
    <comment_count>2</comment_count>
    <who name="Henry Bruce">henry.bruce</who>
    <bug_when>2016-09-23 18:15:55 +0000</bug_when>
    <thetext>I hacked this together. There will be better solutions...

# Script to archive a subset of packages matching specific licence(s)
# Source and license files are copied into subfolders of package folder
# Must be run from build folder
#!/bin/bash
src_release_dir=&quot;source-release&quot;
mkdir -p $src_release_dir
for a in tmp/deploy/sources/*; do
   for d in $a/*; do
      # Get package name from path
      p=`basename $d`
      p=${p%-*}
      p=${p%-*}
      # Only archive GPL packages (update *GPL* regex for your license check)
      numfiles=`ls tmp/deploy/licenses/$p/*GPL* 2&gt; /dev/null | wc -l`
      if [ $numfiles -gt 1 ]; then
         echo Archiving $p
         mkdir -p $src_release_dir/$p/source
         cp $d/* $src_release_dir/$p/source 2&gt; /dev/null
         mkdir -p $src_release_dir/$p/license
         cp tmp/deploy/licenses/$p/* source-release/$p/license 2&gt; /dev/null
      fi
   done
done</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>66585</commentid>
    <comment_count>3</comment_count>
    <who name="Scott Rifenbark">srifenbark</who>
    <bug_when>2016-09-26 15:51:20 +0000</bug_when>
    <thetext>Hi, 

Thanks for the bits... So I changed the introductory wording to reflect that the example is a script and then substituted the three-line example with yours.  See http://www.yoctoproject.org/docs/2.2/dev-manual/dev-manual.html#providing-the-source-code and let me know if this works.

Thanks, 
Scott</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>66596</commentid>
    <comment_count>4</comment_count>
    <who name="Henry Bruce">henry.bruce</who>
    <bug_when>2016-09-26 16:46:05 +0000</bug_when>
    <thetext>Thanks for quick turnaround on this.

I made an error in
cp tmp/deploy/licenses/$p/* source-release/$p/license 2&gt; /dev/null

Should read
cp tmp/deploy/licenses/$p/* $src_release_dir/$p/license 2&gt; /dev/null


I&apos;d like sign-off by Paul and have also added Beth to CC list.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>66598</commentid>
    <comment_count>5</comment_count>
    <who name="Scott Rifenbark">srifenbark</who>
    <bug_when>2016-09-26 16:52:47 +0000</bug_when>
    <thetext>Henry, 

Got it.  See http://www.yoctoproject.org/docs/2.2/dev-manual/dev-manual.html#providing-the-source-code.  We will wait for other feedback before changing bug status. 

Thanks, 
Scott</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>67252</commentid>
    <comment_count>6</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2016-10-14 03:28:03 +0000</bug_when>
    <thetext>It&apos;s a little ugly but I think that&apos;s what we can go with for 2.2.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>67274</commentid>
    <comment_count>7</comment_count>
    <who name="Scott Rifenbark">srifenbark</who>
    <bug_when>2016-10-14 19:14:15 +0000</bug_when>
    <thetext>Because it is ugly, I am going to set the target for 2.3.  We beautify it then.

Thanks
Scott</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68124</commentid>
    <comment_count>8</comment_count>
    <who name="Scott Rifenbark">srifenbark</who>
    <bug_when>2016-11-08 17:39:07 +0000</bug_when>
    <thetext>Hi, 

Now that 2.2 is out, what can be done to make this solution less &quot;ugly&quot;?

Scott</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69761</commentid>
    <comment_count>9</comment_count>
    <who name="Stephen K Jolley">sjolley.yp.pm</who>
    <bug_when>2017-01-12 16:31:35 +0000</bug_when>
    <thetext>Please review comments</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69770</commentid>
    <comment_count>10</comment_count>
    <who name="Henry Bruce">henry.bruce</who>
    <bug_when>2017-01-12 17:58:37 +0000</bug_when>
    <thetext>Not sure what to do. This script is no longer broken and is now functional but ugly. I&apos;ll to Paul for guidance in cleaning it up. Or maybe we move from docs to tips and tricks?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69950</commentid>
    <comment_count>11</comment_count>
    <who name="Scott Rifenbark">srifenbark</who>
    <bug_when>2017-01-19 23:57:11 +0000</bug_when>
    <thetext>Ok - so my suggestion is to &quot;RESOLVE&quot; this one.  If we want a prettier one then file a new bug and we will go from there.  Since you own the bug Henry... I will let you make the call and set to RESOLVED and turn the doc flag to &quot;done.&quot;

Thanks,
Scott</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>71227</commentid>
    <comment_count>12</comment_count>
      <attachid>3647</attachid>
    <who name="Henry Bruce">henry.bruce</who>
    <bug_when>2017-03-13 20:53:31 +0000</bug_when>
    <thetext>Created attachment 3647
License specific source archive creation script</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>71228</commentid>
    <comment_count>13</comment_count>
    <who name="Henry Bruce">henry.bruce</who>
    <bug_when>2017-03-13 20:55:08 +0000</bug_when>
    <thetext>I re-tested script and added a test to check that build had been run with source archiver enabled.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>71253</commentid>
    <comment_count>14</comment_count>
    <who name="Scott Rifenbark">srifenbark</who>
    <bug_when>2017-03-14 15:58:54 +0000</bug_when>
    <thetext>Hi, 

I don&apos;t own this bug but it has been set to RESOLVED based on some doc fixes admittedly ugly but functional.  I have set the doc flag to &quot;done&quot;.

Scott</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>3647</attachid>
            <date>2017-03-13 20:53:31 +0000</date>
            <delta_ts>2017-03-13 20:53:31 +0000</delta_ts>
            <desc>License specific source archive creation script</desc>
            <filename>yocto-license-script</filename>
            <type>application/octet-stream</type>
            <size>985</size>
            <attacher name="Henry Bruce">henry.bruce</attacher>
            
              <data encoding="base64">IyEvYmluL2Jhc2gKIyBTY3JpcHQgdG8gYXJjaGl2ZSBhIHN1YnNldCBvZiBwYWNrYWdlcyBtYXRj
aGluZyBzcGVjaWZpYyBsaWNlbnNlKHMpCiMgU291cmNlIGFuZCBsaWNlbnNlIGZpbGVzIGFyZSBj
b3BpZWQgaW50byBzdWIgZm9sZGVycyBvZiBwYWNrYWdlIGZvbGRlcgojIE11c3QgYmUgcnVuIGZy
b20gYnVpbGQgZm9sZGVyCiMhL2Jpbi9iYXNoCmlmIFsgISAtZSB0bXAvZGVwbG95L3NvdXJjZXMg
XTsgdGhlbgogIGVjaG8gInRtcC9kZXBsb3kvc291cmNlcyBkb2VzIG5vdCBleGlzdC4gUmUtcnVu
IGJ1aWxkIHdpdGggc291cmNlIGFyY2hpdmluZyBlbmFibGVkIgogIGV4aXQgLTEKZmkKc3JjX3Jl
bGVhc2VfZGlyPSJzb3VyY2UtcmVsZWFzZSIKbWtkaXIgLXAgJHNyY19yZWxlYXNlX2Rpcgpmb3Ig
YSBpbiB0bXAvZGVwbG95L3NvdXJjZXMvKjsgZG8KICBmb3IgZCBpbiAkYS8qOyBkbwogICAgICMg
R2V0IHBhY2thZ2UgbmFtZSBmcm9tIHBhdGgKICAgICBwPWBiYXNlbmFtZSAkZGAKICAgICBwPSR7
cCUtKn0KICAgICBwPSR7cCUtKn0KICAgICAjIE9ubHkgYXJjaGl2ZSBHUEwgcGFja2FnZXMgKHVw
ZGF0ZSAqR1BMKiByZWdleCBmb3IgeW91ciBsaWNlbnNlIGNoZWNrKQogICAgIG51bWZpbGVzPWBs
cyB0bXAvZGVwbG95L2xpY2Vuc2VzLyRwLypHUEwqIDI+IC9kZXYvbnVsbCB8IHdjIC1sYAogICAg
IGlmIFsgJG51bWZpbGVzIC1ndCAxIF07IHRoZW4KICAgICAgICBlY2hvIEFyY2hpdmluZyA9PSRw
PT0KICAgICAgICBta2RpciAtcCAkc3JjX3JlbGVhc2VfZGlyLyRwL3NvdXJjZQogICAgICAgIGNw
ICRkLyogJHNyY19yZWxlYXNlX2Rpci8kcC9zb3VyY2UgMj4gL2Rldi9udWxsCiAgICAgICAgbWtk
aXIgLXAgJHNyY19yZWxlYXNlX2Rpci8kcC9saWNlbnNlCiAgICAgICAgY3AgdG1wL2RlcGxveS9s
aWNlbnNlcy8kcC8qICRzcmNfcmVsZWFzZV9kaXIvJHAvbGljZW5zZSAyPiAvZGV2L251bGwKICAg
ICBmaQogIGRvbmUKZG9uZQ==
</data>

          </attachment>
      

    </bug>

</bugzilla>