[OE-core] [PATCH] license.bbclass: remove existing license.manifest before appending new data

Eric Bénard eric at eukrea.com
Fri Mar 30 06:20:11 UTC 2012


Le Thu, 29 Mar 2012 16:22:06 -0700,
Chris Larson <clarson at kergoth.com> a écrit :

> On Thu, Mar 29, 2012 at 5:22 AM, Eric Bénard <eric at eukrea.com> wrote:
> > without this fix, we append license each time we build again the same image,
> > ending with a large not up to date file.
> >
> > Signed-off-by: Eric Bénard <eric at eukrea.com>
> > ---
> >  meta/classes/license.bbclass |    4 ++++
> >  1 files changed, 4 insertions(+), 0 deletions(-)
> >
> > diff --git a/meta/classes/license.bbclass b/meta/classes/license.bbclass
> > index 394a6d4..c85233c 100644
> > --- a/meta/classes/license.bbclass
> > +++ b/meta/classes/license.bbclass
> > @@ -79,6 +79,10 @@ license_create_manifest() {
> >        # Get list of installed packages
> >        list_installed_packages | grep -v "locale" |sort > ${LICENSE_DIRECTORY}/${IMAGE_NAME}/package.manifest
> >        INSTALLED_PKGS=`cat ${LICENSE_DIRECTORY}/${IMAGE_NAME}/package.manifest`
> > +       # remove existing license.manifest file
> > +       if [ -f ${LICENSE_DIRECTORY}/${IMAGE_NAME}/license.manifest ]; then
> > +               rm ${LICENSE_DIRECTORY}/${IMAGE_NAME}/license.manifest
> > +       fi
> >        # list of installed packages is broken for deb
> 
> Probably not a concern in this particular case, but in general you
> should avoid this sort of construct, as it's racy.

ok, what would be the right way to do that to avoid the race problem ?

Eric


-- 
http://eukrea.com/en/news/104-2012




More information about the Openembedded-core mailing list