* [PATCH v2 0/1] archive.bbclass: archive work directory
@ 2012-01-11 7:34 wenzong.fan
2012-01-11 7:34 ` [PATCH v2 1/1] " wenzong.fan
2012-01-12 7:31 ` [PATCH v2 0/1] " Saul Wold
0 siblings, 2 replies; 5+ messages in thread
From: wenzong.fan @ 2012-01-11 7:34 UTC (permalink / raw)
To: openembedded-core
From: Wenzong Fan <wenzong.fan@windriver.com>
v2 updates:
1) Remove the special-casing for gcc, checking for any packages under
'tmp/work-shared';
2) Remove some bash-specific code, replase the '[[regular-expression]]'
with isovalent 'grep' statement.
The following changes since commit 4a8a3c503fd896593b787c26edbe46a7324e494e:
Richard Purdie (1):
Revert "site/common-uclibc: Cache gl_cv_func_wcwidth_works"
are available in the git repository at:
git://git.pokylinux.org/poky-contrib wenzong/1590
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=wenzong/1590
Wenzong Fan (1):
archive.bbclass: archive work directory
meta/classes/archive.bbclass | 49 ++++++++++++++++++++++++++++++++++++++++++
1 files changed, 49 insertions(+), 0 deletions(-)
create mode 100644 meta/classes/archive.bbclass
^ permalink raw reply [flat|nested] 5+ messages in thread* [PATCH v2 1/1] archive.bbclass: archive work directory
2012-01-11 7:34 [PATCH v2 0/1] archive.bbclass: archive work directory wenzong.fan
@ 2012-01-11 7:34 ` wenzong.fan
2012-01-12 7:31 ` [PATCH v2 0/1] " Saul Wold
1 sibling, 0 replies; 5+ messages in thread
From: wenzong.fan @ 2012-01-11 7:34 UTC (permalink / raw)
To: openembedded-core
From: Wenzong Fan <wenzong.fan@windriver.com>
Some legal departments believe a complete archive of the work directory
is required for certain license compliance issues. We could therefore
do with a class which archives up the work directories in each build and
provide them so those legal departments can be happy.
Implementations:
Add a new class named 'archive.bbclass' to provide task 'do_archive',
and get it called after 'do_patch' before 'do_configure'.
Following cases should be considered to the sources dirs:
1) The sources dir is under $WORKDIR:
Just archive sources and temp/run.* up.
2) The sources dir is outside of $WORKDIR, such as gcc:
Copy its sources and temp/run.* to a temporary dir and then archive
them up.
3) The sources dir is equal to $WORKDIR:
Just archive whole work dir up.
[YOCTO #1590]
Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
---
meta/classes/archive.bbclass | 49 ++++++++++++++++++++++++++++++++++++++++++
1 files changed, 49 insertions(+), 0 deletions(-)
create mode 100644 meta/classes/archive.bbclass
diff --git a/meta/classes/archive.bbclass b/meta/classes/archive.bbclass
new file mode 100644
index 0000000..e529793
--- /dev/null
+++ b/meta/classes/archive.bbclass
@@ -0,0 +1,49 @@
+# Archive the patched sources and build scripts to assist in license
+# compliance by the end user or legal departments.
+
+ARCHIVE_DIR = "${TMPDIR}/archives/${MULTIMACH_TARGET_SYS}/"
+do_archive[dirs] = "${ARCHIVE_DIR}"
+
+archive_do_archive() {
+ # In mostly scenarios the $S is under $WORKDIR and has a separate
+ # dir for storing the sources; but sometimes we also put the same
+ # sources 'tmp/work-shared/' for sharing between different build.
+ if [ -d ${S} -a ${S} != ${WORKDIR} ]; then
+ sources_shared="0"
+
+ if echo ${S} | grep "${TMPDIR}/work-shared" > /dev/null; then
+ sources_shared="1"
+ fi
+
+ if [ x$sources_shared == "x1" ]; then
+ # Create temporary sources directory
+ mkdir -p ${PF}/temp
+ cp -r ${S} ${PF}
+ cp -r ${S}/../temp/* ${PF}/temp
+ cp -r ${WORKDIR}/temp/* ${PF}/temp
+ tarbase=`pwd`
+ sourcedir=`basename ${S}`
+ else
+ tarbase=`dirname ${WORKDIR}`
+ sourcedir=`echo ${S}|sed -e "s#${WORKDIR}/*##g"`
+ fi
+
+ tar -C $tarbase -cjf ${PF}.tar.bz2 ${PF}/$sourcedir \
+ ${PF}/temp --exclude log.do_*
+
+ # Remove the temporary sources directory
+ if [ x$sources_shared == "x1" -a -d ${PF} ]; then
+ rm -rf ${PF}
+ fi
+ fi
+
+ # Just archive whole build directory up when $S is equal to $WORKDIR
+ if [ -d ${S} -a ${S} == ${WORKDIR} ]; then
+ tarbase=`dirname ${WORKDIR}`
+ tar -C $tarbase -cjf ${PF}.tar.bz2 ${PF} --exclude log.do_*
+ fi
+}
+
+addtask do_archive after do_patch before do_configure
+
+EXPORT_FUNCTIONS do_archive
--
1.7.0.4
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH v2 0/1] archive.bbclass: archive work directory
2012-01-11 7:34 [PATCH v2 0/1] archive.bbclass: archive work directory wenzong.fan
2012-01-11 7:34 ` [PATCH v2 1/1] " wenzong.fan
@ 2012-01-12 7:31 ` Saul Wold
2012-01-12 8:04 ` wenzong fan
1 sibling, 1 reply; 5+ messages in thread
From: Saul Wold @ 2012-01-12 7:31 UTC (permalink / raw)
To: Patches and discussions about the oe-core layer, wenzong.fan,
Yan, Xiaofeng, Mark Hatle
On 01/10/2012 11:34 PM, wenzong.fan@windriver.com wrote:
> From: Wenzong Fan<wenzong.fan@windriver.com>
>
> v2 updates:
>
> 1) Remove the special-casing for gcc, checking for any packages under
> 'tmp/work-shared';
>
> 2) Remove some bash-specific code, replase the '[[regular-expression]]'
> with isovalent 'grep' statement.
>
>
So how is this work different than that of Xiaofeng's doing the
tar_archive? Can these two be merged somehow? We also have something
called copyleft complaince, is this similar or somehow different?
We also have src_distribute.bbclass and sourcepkg.bbclass, seems like we
have a more ways to package up source code than we know what to do with.
Mark, we might want to sync up on this and figure out what we really
have and what's really needed here.
Thanks
Sau!
> The following changes since commit 4a8a3c503fd896593b787c26edbe46a7324e494e:
> Richard Purdie (1):
> Revert "site/common-uclibc: Cache gl_cv_func_wcwidth_works"
>
> are available in the git repository at:
>
> git://git.pokylinux.org/poky-contrib wenzong/1590
> http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=wenzong/1590
>
> Wenzong Fan (1):
> archive.bbclass: archive work directory
>
> meta/classes/archive.bbclass | 49 ++++++++++++++++++++++++++++++++++++++++++
> 1 files changed, 49 insertions(+), 0 deletions(-)
> create mode 100644 meta/classes/archive.bbclass
>
>
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2 0/1] archive.bbclass: archive work directory
2012-01-12 7:31 ` [PATCH v2 0/1] " Saul Wold
@ 2012-01-12 8:04 ` wenzong fan
2012-01-12 8:25 ` wenzong fan
0 siblings, 1 reply; 5+ messages in thread
From: wenzong fan @ 2012-01-12 8:04 UTC (permalink / raw)
To: Saul Wold; +Cc: Yan, Xiaofeng, Patches and discussions about the oe-core layer
On 01/12/2012 03:31 PM, Saul Wold wrote:
> On 01/10/2012 11:34 PM, wenzong.fan@windriver.com wrote:
>> From: Wenzong Fan<wenzong.fan@windriver.com>
>>
>> v2 updates:
>>
>> 1) Remove the special-casing for gcc, checking for any packages under
>> 'tmp/work-shared';
>>
>> 2) Remove some bash-specific code, replase the '[[regular-expression]]'
>> with isovalent 'grep' statement.
>>
>>
> So how is this work different than that of Xiaofeng's doing the
> tar_archive? Can these two be merged somehow? We also have something
> called copyleft complaince, is this similar or somehow different?
They are a little similar but mostly are different, #1655 (Xiaofeng's)
will need to export the source packages (such as *.tar, *.rpm ...) for
using, Mark also commented the details at:
http://bugzilla.pokylinux.org/show_bug.cgi?id=1655
But the #1590 (mine) only archive the patched sources/build_scripts up
for later checking.
Thanks
Wenzong
>
> We also have src_distribute.bbclass and sourcepkg.bbclass, seems like
> we have a more ways to package up source code than we know what to do
> with.
>
> Mark, we might want to sync up on this and figure out what we really
> have and what's really needed here.
>
> Thanks
> Sau!
>
>
>
>
>> The following changes since commit
>> 4a8a3c503fd896593b787c26edbe46a7324e494e:
>> Richard Purdie (1):
>> Revert "site/common-uclibc: Cache gl_cv_func_wcwidth_works"
>>
>> are available in the git repository at:
>>
>> git://git.pokylinux.org/poky-contrib wenzong/1590
>> http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=wenzong/1590
>>
>> Wenzong Fan (1):
>> archive.bbclass: archive work directory
>>
>> meta/classes/archive.bbclass | 49
>> ++++++++++++++++++++++++++++++++++++++++++
>> 1 files changed, 49 insertions(+), 0 deletions(-)
>> create mode 100644 meta/classes/archive.bbclass
>>
>>
>> _______________________________________________
>> Openembedded-core mailing list
>> Openembedded-core@lists.openembedded.org
>> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
>>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2 0/1] archive.bbclass: archive work directory
2012-01-12 8:04 ` wenzong fan
@ 2012-01-12 8:25 ` wenzong fan
0 siblings, 0 replies; 5+ messages in thread
From: wenzong fan @ 2012-01-12 8:25 UTC (permalink / raw)
To: Saul Wold; +Cc: Yan, Xiaofeng, Patches and discussions about the oe-core layer
On 01/12/2012 04:04 PM, wenzong fan wrote:
> On 01/12/2012 03:31 PM, Saul Wold wrote:
>> On 01/10/2012 11:34 PM, wenzong.fan@windriver.com wrote:
>>> From: Wenzong Fan<wenzong.fan@windriver.com>
>>>
>>> v2 updates:
>>>
>>> 1) Remove the special-casing for gcc, checking for any packages under
>>> 'tmp/work-shared';
>>>
>>> 2) Remove some bash-specific code, replase the '[[regular-expression]]'
>>> with isovalent 'grep' statement.
>>>
>>>
>> So how is this work different than that of Xiaofeng's doing the
>> tar_archive? Can these two be merged somehow? We also have
>> something called copyleft complaince, is this similar or somehow
>> different?
>
> They are a little similar but mostly are different, #1655 (Xiaofeng's)
> will need to export the source packages (such as *.tar, *.rpm ...) for
> using, Mark also commented the details at:
>
> http://bugzilla.pokylinux.org/show_bug.cgi?id=1655
>
> But the #1590 (mine) only archive the patched sources/build_scripts up
> for later checking.
And I think both the 'archive.bbclass' and 'copyleft_complaince.bbclass'
were designed for some license related issues, but the 'archive.bbclass'
will create snapshot for all sources and 'copyleft_complaince.bbclass'
will do dynamic checking for the licenses.
Thanks
Wenzong
>
> Thanks
> Wenzong
>
>>
>> We also have src_distribute.bbclass and sourcepkg.bbclass, seems like
>> we have a more ways to package up source code than we know what to do
>> with.
>>
>> Mark, we might want to sync up on this and figure out what we really
>> have and what's really needed here.
>>
>> Thanks
>> Sau!
>>
>>
>>
>>
>>> The following changes since commit
>>> 4a8a3c503fd896593b787c26edbe46a7324e494e:
>>> Richard Purdie (1):
>>> Revert "site/common-uclibc: Cache gl_cv_func_wcwidth_works"
>>>
>>> are available in the git repository at:
>>>
>>> git://git.pokylinux.org/poky-contrib wenzong/1590
>>> http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=wenzong/1590
>>>
>>> Wenzong Fan (1):
>>> archive.bbclass: archive work directory
>>>
>>> meta/classes/archive.bbclass | 49
>>> ++++++++++++++++++++++++++++++++++++++++++
>>> 1 files changed, 49 insertions(+), 0 deletions(-)
>>> create mode 100644 meta/classes/archive.bbclass
>>>
>>>
>>> _______________________________________________
>>> 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
>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2012-01-12 8:32 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-11 7:34 [PATCH v2 0/1] archive.bbclass: archive work directory wenzong.fan
2012-01-11 7:34 ` [PATCH v2 1/1] " wenzong.fan
2012-01-12 7:31 ` [PATCH v2 0/1] " Saul Wold
2012-01-12 8:04 ` wenzong fan
2012-01-12 8:25 ` wenzong fan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox