Patchwork [3/3] archiver_configure.bbclass: configure the content for archiving package

login
register
mail settings
Submitter Xiaofeng Yan
Date March 3, 2012, 10:54 a.m.
Message ID <6b45ee6d33a54d9abcbc0dd28f383a4993795017.1330771239.git.xiaofeng.yan@windriver.com>
Download mbox | patch
Permalink /patch/22619/
State New
Headers show

Comments

Xiaofeng Yan - March 3, 2012, 10:54 a.m.
From: Xiaofeng Yan <xiaofeng.yan@windriver.com>

This is configuration file to point to what content a archive package
should include in the different stage of task by pointing to different variable and
stage.

[YOCTO #1977]

Signed-off-by: Xiaofeng Yan <xiaofeng.yan@windriver.com>

Signed-off-by: Xiaofeng Yan <xiaofeng.yan@windriver.com>
---
 meta/classes/archiver_configure.bbclass |   35 +++++++++++++++++++++++++++++++
 1 files changed, 35 insertions(+), 0 deletions(-)
 create mode 100644 meta/classes/archiver_configure.bbclass
Saul Wold - March 5, 2012, 10:18 p.m.
On 03/03/2012 02:54 AM, Xiaofeng Yan wrote:
> From: Xiaofeng Yan<xiaofeng.yan@windriver.com>
>
> This is configuration file to point to what content a archive package
> should include in the different stage of task by pointing to different variable and
> stage.
>
Xiaogeng,

You are on the right path with this one, but what was originally talked 
about was having multiple archiver bbclasses that did the configuration 
and set when the archive would take place.

Than one could just inherit the bbclass that matches their needs, so 
there should be a bbclass that's equivalent to the current copyleft 
bbclass. And as we defined in earlier emails the 3-4 archives, we should 
have matching bbclasses for those.

1) Original Source & Patches w/ Series file & other files
2) Patched & Configured Source & temp dir
3) Copyleft Equivlant (so we can remove that class also)

Sau!


> [YOCTO #1977]
>
> Signed-off-by: Xiaofeng Yan<xiaofeng.yan@windriver.com>
>
> Signed-off-by: Xiaofeng Yan<xiaofeng.yan@windriver.com>
> ---
>   meta/classes/archiver_configure.bbclass |   35 +++++++++++++++++++++++++++++++
>   1 files changed, 35 insertions(+), 0 deletions(-)
>   create mode 100644 meta/classes/archiver_configure.bbclass
>
> diff --git a/meta/classes/archiver_configure.bbclass b/meta/classes/archiver_configure.bbclass
> new file mode 100644
> index 0000000..c9892d3
> --- /dev/null
> +++ b/meta/classes/archiver_configure.bbclass
> @@ -0,0 +1,35 @@
> +# This file is for getting tarball in different stage for sources, patches, and logs by configuring
> +# the following variable and tasks
> +
> +inherit archiver
> +
> +# SOURCE_ARCHIVE_PACKAGE_TYPE = {'tar','srpm'}
> +SOURCE_ARCHIVE_PACKAGE_TYPE = 'tar'
> +
> +# SOURCE_ARCHIVE_LOG_WITH_SCRIPTS = {'logs_with_scripts', 'logs'}
> +# String 'logs_with_scripts' include temp directory and .bb and .inc file
> +# String 'logs' only include temp
> +SOURCE_ARCHIVE_LOG_WITH_SCRIPTS = 'logs_with_scripts'
> +
> +# PATCHES_ARCHIVE_WITH_SERIES = {'true', 'false'}
> +# Strings 'true' means that patches including series files(series + non-applying)
> +# String 'false' means that no series and only archive applying patches
> +PATCHES_ARCHIVE_WITH_SERIES = 'true'
> +
> +# Archive packages for copy-left
> +#COPYLEFT_COMPLIANCE = 'true'
> +
> +# Open this item when you want to get original sources tarball with patches
> +do_unpack[postfuncs] += "do_archive_original_sources_patches "
> +
> +# Open this item when you want to get tarball for patched sources including patches
> +#do_patch[postfuncs] += "do_archive_patched_sources "
> +
> +# Open this item when you want to get tarball for configured sources including patches
> +#do_configure[postfuncs] += "do_archive_configured_sources "
> +
> +# Open this item when you want to get tarball for logs tarball
> +do_package_write_rpm[prefuncs] += "do_archive_scripts_logs "
> +
> +# Get dump date and create diff file
> +do_package_write_rpm[postfuncs] += "do_dumpdata_create_diff_gz "
Xiaofeng Yan - March 6, 2012, 11:11 a.m.
On 2012?03?06? 06:18, Saul Wold wrote:
> On 03/03/2012 02:54 AM, Xiaofeng Yan wrote:
>> From: Xiaofeng Yan<xiaofeng.yan@windriver.com>
>>
>> This is configuration file to point to what content a archive package
>> should include in the different stage of task by pointing to 
>> different variable and
>> stage.
>>
> Xiaogeng,
>
> You are on the right path with this one, but what was originally 
> talked about was having multiple archiver bbclasses that did the 
> configuration and set when the archive would take place.
>
> Than one could just inherit the bbclass that matches their needs, so 
> there should be a bbclass that's equivalent to the current copyleft 
> bbclass. And as we defined in earlier emails the 3-4 archives, we 
> should have matching bbclasses for those.
>
Thanks for your reply.
> 1) Original Source & Patches w/ Series file & other files
This needs two bbclass named for 
"tar_original_source_patch_serires_scripts_logs.bblcass" and 
"srpm_original_source_patch_serires_scripts_logs.bblcass". 
archiver.bbclass should be inherited in two bbclass.

"scripts" include .bb and .inc files.
"logs" include temp.
I take zlib for an example with tar type:
step 1: inherit tar_original_source_patch_serires_scripts_logs in 
pakcage_rpm.bbclass.
step 2:
/$bitbake zlib/
step 3:
/$ ls  tmp/deploy/sources/i586-poky-linux/Zlib/zlib-1.2.6-r1/
zlib-1.2.6-r1-patches.tar.gz  zlib-1.2.6-r1-prepatch.tar.gz  
zlib-1.2.6-r1-script-logs.tar.gz/

I organize the directory to deploy archiving package with the following 
mode.
tar_sources = d.getVar('DEPLOY_DIR', True) + '/sources/' + target_sys + 
'/' + licenses + '/' + pf
here:

target_sys is  i586-poky-linux
Zlib is license of package zlib
pf is "zlib-1.2.6-r1"
//zlib-1.2.6-r1-prepatch.tar.gz  include original sources
zlib-1.2.6-r1-patches.tar.gz include patches and series
zlib-1.2.6-r1-script-logs.tar.gz include temp with .bb and .inc files
/
/if we want to get srpm package. we should inherit 
srpm_original_source_patch_serires_scripts_logs.bblcass in 
package_rpm.bbclass
$bitbake zlib
$ls /tmp/deploy/sources/deploy-srpm/i586/Zlib//
zlib-1.2.6-r1.src.rpm
/
/
> 2) Patched & Configured Source & temp dir
This needs four bbclass
tar_patched_sources_logs.bbclass
tar_configured_sources_logs.bbclass
srpm_patched_sources_logs.bbclass
srpm_configured_sources_logs.bbclass

> 3) Copyleft Equivlant (so we can remove that class also)
I only inherit this class in archiver.bbclass in V1 without merging it 
to archiver.bbclass.  I can merge this class if you want.

  I think we can define some variables like SOURCE_ARCHIVE_PACKAGE_TYPE 
= {'tar','srpm'} and SOURCE_ARCHIVE_LOGS_WITH_SCRIPTS = 'True'
SOURCE_ARCHIVE_LOGS = 'True' in conf/local.conf to reduce the number of 
archive bbclass.

I will send you the V2 according to your reply.
**
I do apologize about my design can't meet your requirement.
>
> Sau!
>
>
>> [YOCTO #1977]
>>
>> Signed-off-by: Xiaofeng Yan<xiaofeng.yan@windriver.com>
>>
>> Signed-off-by: Xiaofeng Yan<xiaofeng.yan@windriver.com>
>> ---
>>   meta/classes/archiver_configure.bbclass |   35 
>> +++++++++++++++++++++++++++++++
>>   1 files changed, 35 insertions(+), 0 deletions(-)
>>   create mode 100644 meta/classes/archiver_configure.bbclass
>>
>> diff --git a/meta/classes/archiver_configure.bbclass 
>> b/meta/classes/archiver_configure.bbclass
>> new file mode 100644
>> index 0000000..c9892d3
>> --- /dev/null
>> +++ b/meta/classes/archiver_configure.bbclass
>> @@ -0,0 +1,35 @@
>> +# This file is for getting tarball in different stage for sources, 
>> patches, and logs by configuring
>> +# the following variable and tasks
>> +
>> +inherit archiver
>> +
>> +# SOURCE_ARCHIVE_PACKAGE_TYPE = {'tar','srpm'}
>> +SOURCE_ARCHIVE_PACKAGE_TYPE = 'tar'
>> +
>> +# SOURCE_ARCHIVE_LOG_WITH_SCRIPTS = {'logs_with_scripts', 'logs'}
>> +# String 'logs_with_scripts' include temp directory and .bb and .inc 
>> file
>> +# String 'logs' only include temp
>> +SOURCE_ARCHIVE_LOG_WITH_SCRIPTS = 'logs_with_scripts'
>> +
>> +# PATCHES_ARCHIVE_WITH_SERIES = {'true', 'false'}
>> +# Strings 'true' means that patches including series files(series + 
>> non-applying)
>> +# String 'false' means that no series and only archive applying patches
>> +PATCHES_ARCHIVE_WITH_SERIES = 'true'
>> +
>> +# Archive packages for copy-left
>> +#COPYLEFT_COMPLIANCE = 'true'
>> +
>> +# Open this item when you want to get original sources tarball with 
>> patches
>> +do_unpack[postfuncs] += "do_archive_original_sources_patches "
>> +
>> +# Open this item when you want to get tarball for patched sources 
>> including patches
>> +#do_patch[postfuncs] += "do_archive_patched_sources "
>> +
>> +# Open this item when you want to get tarball for configured sources 
>> including patches
>> +#do_configure[postfuncs] += "do_archive_configured_sources "
>> +
>> +# Open this item when you want to get tarball for logs tarball
>> +do_package_write_rpm[prefuncs] += "do_archive_scripts_logs "
>> +
>> +# Get dump date and create diff file
>> +do_package_write_rpm[postfuncs] += "do_dumpdata_create_diff_gz "
>
Mark Hatle - March 12, 2012, 6:58 p.m.
A few quick comments to match up with the patch 2/3 comments..

On 3/3/12 4:54 AM, Xiaofeng Yan wrote:
> From: Xiaofeng Yan<xiaofeng.yan@windriver.com>
>
> This is configuration file to point to what content a archive package
> should include in the different stage of task by pointing to different variable and
> stage.
>
> [YOCTO #1977]
>
> Signed-off-by: Xiaofeng Yan<xiaofeng.yan@windriver.com>
>
> Signed-off-by: Xiaofeng Yan<xiaofeng.yan@windriver.com>
> ---
>   meta/classes/archiver_configure.bbclass |   35 +++++++++++++++++++++++++++++++
>   1 files changed, 35 insertions(+), 0 deletions(-)
>   create mode 100644 meta/classes/archiver_configure.bbclass
>
> diff --git a/meta/classes/archiver_configure.bbclass b/meta/classes/archiver_configure.bbclass
> new file mode 100644
> index 0000000..c9892d3
> --- /dev/null
> +++ b/meta/classes/archiver_configure.bbclass

This seems odd that configuration items would be in a .bbclass file.  I would 
have expected the configuration to inherit the archiver, and then either a 
default set of values be specified in the archive.bbclass or in the bitbake.conf 
(or similar)....

As for the defaults below, I think they are fine....

> @@ -0,0 +1,35 @@
> +# This file is for getting tarball in different stage for sources, patches, and logs by configuring
> +# the following variable and tasks
> +
> +inherit archiver
> +
> +# SOURCE_ARCHIVE_PACKAGE_TYPE = {'tar','srpm'}
> +SOURCE_ARCHIVE_PACKAGE_TYPE = 'tar'
> +
> +# SOURCE_ARCHIVE_LOG_WITH_SCRIPTS = {'logs_with_scripts', 'logs'}
> +# String 'logs_with_scripts' include temp directory and .bb and .inc file
> +# String 'logs' only include temp
> +SOURCE_ARCHIVE_LOG_WITH_SCRIPTS = 'logs_with_scripts'
> +
> +# PATCHES_ARCHIVE_WITH_SERIES = {'true', 'false'}
> +# Strings 'true' means that patches including series files(series + non-applying)
> +# String 'false' means that no series and only archive applying patches
> +PATCHES_ARCHIVE_WITH_SERIES = 'true'
> +
> +# Archive packages for copy-left
> +#COPYLEFT_COMPLIANCE = 'true'
> +
> +# Open this item when you want to get original sources tarball with patches
> +do_unpack[postfuncs] += "do_archive_original_sources_patches "

Instead of do_unpack[postfuncs] would a do_patch[prefuncs] be better?  This 
would ensure that do_unpack and all other tasks between do_unpack and do_patch 
were run first... then do we can archive the results..

> +
> +# Open this item when you want to get tarball for patched sources including patches
> +#do_patch[postfuncs] += "do_archive_patched_sources "

Perhaps the same here between do_patch and do_configure...

--Mark

> +
> +# Open this item when you want to get tarball for configured sources including patches
> +#do_configure[postfuncs] += "do_archive_configured_sources "
> +
> +# Open this item when you want to get tarball for logs tarball
> +do_package_write_rpm[prefuncs] += "do_archive_scripts_logs "
> +
> +# Get dump date and create diff file
> +do_package_write_rpm[postfuncs] += "do_dumpdata_create_diff_gz "
> -- 1.7.0.4 _______________________________________________ Openembedded-core
> mailing list Openembedded-core@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
>
Xiaofeng Yan - March 13, 2012, 6:48 a.m.
On 2012?03?13? 02:58, Mark Hatle wrote:
> A few quick comments to match up with the patch 2/3 comments..
>
> On 3/3/12 4:54 AM, Xiaofeng Yan wrote:
>> From: Xiaofeng Yan<xiaofeng.yan@windriver.com>
>>
>> This is configuration file to point to what content a archive package
>> should include in the different stage of task by pointing to 
>> different variable and
>> stage.
>>
>> [YOCTO #1977]
>>
>> Signed-off-by: Xiaofeng Yan<xiaofeng.yan@windriver.com>
>>
>> Signed-off-by: Xiaofeng Yan<xiaofeng.yan@windriver.com>
>> ---
>> meta/classes/archiver_configure.bbclass | 35 
>> +++++++++++++++++++++++++++++++
>> 1 files changed, 35 insertions(+), 0 deletions(-)
>> create mode 100644 meta/classes/archiver_configure.bbclass
>>
>> diff --git a/meta/classes/archiver_configure.bbclass 
>> b/meta/classes/archiver_configure.bbclass
>> new file mode 100644
>> index 0000000..c9892d3
>> --- /dev/null
>> +++ b/meta/classes/archiver_configure.bbclass
>
> This seems odd that configuration items would be in a .bbclass file. I 
> would have expected the configuration to inherit the archiver, and 
> then either a default set of values be specified in the 
> archive.bbclass or in the bitbake.conf (or similar)....
>
> As for the defaults below, I think they are fine....
>
I will define a default set in local.conf.sample in V2
>> @@ -0,0 +1,35 @@
>> +# This file is for getting tarball in different stage for sources, 
>> patches, and logs by configuring
>> +# the following variable and tasks
>> +
>> +inherit archiver
>> +
>> +# SOURCE_ARCHIVE_PACKAGE_TYPE = {'tar','srpm'}
>> +SOURCE_ARCHIVE_PACKAGE_TYPE = 'tar'
>> +
>> +# SOURCE_ARCHIVE_LOG_WITH_SCRIPTS = {'logs_with_scripts', 'logs'}
>> +# String 'logs_with_scripts' include temp directory and .bb and .inc 
>> file
>> +# String 'logs' only include temp
>> +SOURCE_ARCHIVE_LOG_WITH_SCRIPTS = 'logs_with_scripts'
>> +
>> +# PATCHES_ARCHIVE_WITH_SERIES = {'true', 'false'}
>> +# Strings 'true' means that patches including series files(series + 
>> non-applying)
>> +# String 'false' means that no series and only archive applying patches
>> +PATCHES_ARCHIVE_WITH_SERIES = 'true'
>> +
>> +# Archive packages for copy-left
>> +#COPYLEFT_COMPLIANCE = 'true'
>> +
>> +# Open this item when you want to get original sources tarball with 
>> patches
>> +do_unpack[postfuncs] += "do_archive_original_sources_patches "
>
> Instead of do_unpack[postfuncs] would a do_patch[prefuncs] be better? 
> This would ensure that do_unpack and all other tasks between do_unpack 
> and do_patch were run first... then do we can archive the results..
>
Some bb files do some chages after do_unpack before do_patch. The 
following bb files are the case. Perhaps some other bb files could 
change some stuff before do_patch. So I archive sources codes in 
do_unpack[postfuncs].

meta$ grep "do_unpack_append" . -nr
./recipes-core/eglibc/eglibc_2.15.bb:76:do_unpack_append() {
./recipes-core/eglibc/eglibc_2.13.bb:73:do_unpack_append() {
./recipes-sato/web/web_git.bb:19:do_unpack_append () {
./recipes-extended/ltp/ltp_20120104.bb:46:do_unpack_append() {



>> +
>> +# Open this item when you want to get tarball for patched sources 
>> including patches
>> +#do_patch[postfuncs] += "do_archive_patched_sources "
>
> Perhaps the same here between do_patch and do_configure...
>
> --Mark
>
>> +
>> +# Open this item when you want to get tarball for configured sources 
>> including patches
>> +#do_configure[postfuncs] += "do_archive_configured_sources "
>> +
>> +# Open this item when you want to get tarball for logs tarball
>> +do_package_write_rpm[prefuncs] += "do_archive_scripts_logs "
>> +
>> +# Get dump date and create diff file
>> +do_package_write_rpm[postfuncs] += "do_dumpdata_create_diff_gz "
>> -- 1.7.0.4 _______________________________________________ 
>> Openembedded-core
>> mailing list Openembedded-core@lists.openembedded.org
>> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
>>
>
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
>

Patch

diff --git a/meta/classes/archiver_configure.bbclass b/meta/classes/archiver_configure.bbclass
new file mode 100644
index 0000000..c9892d3
--- /dev/null
+++ b/meta/classes/archiver_configure.bbclass
@@ -0,0 +1,35 @@ 
+# This file is for getting tarball in different stage for sources, patches, and logs by configuring 
+# the following variable and tasks
+
+inherit archiver
+
+# SOURCE_ARCHIVE_PACKAGE_TYPE = {'tar','srpm'}
+SOURCE_ARCHIVE_PACKAGE_TYPE = 'tar'
+
+# SOURCE_ARCHIVE_LOG_WITH_SCRIPTS = {'logs_with_scripts', 'logs'}
+# String 'logs_with_scripts' include temp directory and .bb and .inc file
+# String 'logs' only include temp 
+SOURCE_ARCHIVE_LOG_WITH_SCRIPTS = 'logs_with_scripts'
+
+# PATCHES_ARCHIVE_WITH_SERIES = {'true', 'false'}
+# Strings 'true' means that patches including series files(series + non-applying)
+# String 'false' means that no series and only archive applying patches
+PATCHES_ARCHIVE_WITH_SERIES = 'true'
+
+# Archive packages for copy-left
+#COPYLEFT_COMPLIANCE = 'true'
+
+# Open this item when you want to get original sources tarball with patches
+do_unpack[postfuncs] += "do_archive_original_sources_patches "
+
+# Open this item when you want to get tarball for patched sources including patches
+#do_patch[postfuncs] += "do_archive_patched_sources "
+
+# Open this item when you want to get tarball for configured sources including patches
+#do_configure[postfuncs] += "do_archive_configured_sources "
+
+# Open this item when you want to get tarball for logs tarball
+do_package_write_rpm[prefuncs] += "do_archive_scripts_logs "
+
+# Get dump date and create diff file 
+do_package_write_rpm[postfuncs] += "do_dumpdata_create_diff_gz "