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
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
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="source-release" 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> /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> /dev/null mkdir -p $src_release_dir/$p/license cp tmp/deploy/licenses/$p/* source-release/$p/license 2> /dev/null fi done done
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
Thanks for quick turnaround on this. I made an error in cp tmp/deploy/licenses/$p/* source-release/$p/license 2> /dev/null Should read cp tmp/deploy/licenses/$p/* $src_release_dir/$p/license 2> /dev/null I'd like sign-off by Paul and have also added Beth to CC list.
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
It's a little ugly but I think that's what we can go with for 2.2.
Because it is ugly, I am going to set the target for 2.3. We beautify it then. Thanks Scott
Hi, Now that 2.2 is out, what can be done to make this solution less "ugly"? Scott
Please review comments
Not sure what to do. This script is no longer broken and is now functional but ugly. I'll to Paul for guidance in cleaning it up. Or maybe we move from docs to tips and tricks?
Ok - so my suggestion is to "RESOLVE" 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 "done." Thanks, Scott
Created attachment 3647 [details] License specific source archive creation script
I re-tested script and added a test to check that build had been run with source archiver enabled.
Hi, I don'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 "done". Scott