All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: Patches and discussions about the oe-core layer
	<openembedded-core@lists.openembedded.org>
Subject: Re: [PATCH] gtk-icon-cache.bbclass: Fix multiple rebuilds of the icon cache on first boot
Date: Fri, 23 Mar 2012 23:37:43 +0000	[thread overview]
Message-ID: <1332545863.9740.477.camel@ted> (raw)
In-Reply-To: <CALbNGRT8Wb2gt7un4efD+szwz3kPZ5pns-4G6EusspH5iYYuZA@mail.gmail.com>

On Fri, 2012-03-23 at 23:46 +0100, Andreas Müller wrote:
> On Fri, Mar 23, 2012 at 1:12 PM, Richard Purdie
> <richard.purdie@linuxfoundation.org> wrote:
> > On Thu, 2012-03-22 at 20:15 +0100, Andreas Müller wrote:
> >> * Before this patch every inheritance of this class rebuilt the full icon cache at the first boot.
> >> * With this patch the icon cache will only be build once at the first boot and on pkg installations that require it.
> >> * This patch reduces the time needed for the first boot from 96 minutes to 5 minutes on the test machine.
> >> * Build-tested incremental (BB_SIGNATURE_HANDLER = "OEBasicHash") & from scratch
> >> * Run-tested with systemd and opkg
> >>
> >> Signed-off-by: Samuel Stirtzel <s.stirtzel@googlemail.com>
> >> Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com>
> >> ---
> >>  meta/classes/gtk-icon-cache.bbclass                |   19 +++++++++-------
> >>  .../gtk+/gtk-update-icon-cache-runonce.bb          |   23 ++++++++++++++++++++
> >>  .../gtk-update-icon-cache-runonce.in               |   16 +++++++++++++
> >>  3 files changed, 50 insertions(+), 8 deletions(-)
> >>  create mode 100644 meta/recipes-gnome/gtk+/gtk-update-icon-cache-runonce.bb
> >>  create mode 100644 meta/recipes-gnome/gtk+/gtk-update-icon-cache-runonce/gtk-update-icon-cache-runonce.in
> >>
> >> diff --git a/meta/classes/gtk-icon-cache.bbclass b/meta/classes/gtk-icon-cache.bbclass
> >> index 60e3401..b48aabe 100644
> >> --- a/meta/classes/gtk-icon-cache.bbclass
> >> +++ b/meta/classes/gtk-icon-cache.bbclass
> >> @@ -9,14 +9,16 @@ if [ "x$D" != "x" ]; then
> >>          exit 1
> >>  fi
> >>
> >> -# Update the pixbuf loaders in case they haven't been registered yet
> >> -GDK_PIXBUF_MODULEDIR=${libdir}/gdk-pixbuf-2.0/2.10.0/loaders gdk-pixbuf-query-loaders --update-cache
> >> -
> >> -for icondir in /usr/share/icons/* ; do
> >> -    if [ -d $icondir ] ; then
> >> -        gtk-update-icon-cache -fqt  $icondir
> >> -    fi
> >> -done
> >> +# do not execute in case a final run-once is waiting
> >> +if [ ! -e ${sysconfdir}/init.d/gtk-update-icon-cache-runonce ]; then
> >> +    # Update the pixbuf loaders in case they haven't been registered yet
> >> +    GDK_PIXBUF_MODULEDIR=${libdir}/gdk-pixbuf-2.0/2.10.0/loaders gdk-pixbuf-query-loaders --update-cache
> >> +    for icondir in /usr/share/icons/* ; do
> >> +        if [ -d $icondir ] ; then
> >> +            gtk-update-icon-cache -fqt  $icondir
> >> +        fi
> >> +    done
> >> +fi
> >
> >
> > Can't we just reduce this to adding a "touch
> > ${sysconfdir}/init.d/gtk-update-icon-cache-runonce" to the above code
> > and then clear that file at boot time?
> >
> Maybe it's a misunderstanding on my side but how shall an empty file
> cover the three tasks during 1st boot:
> 
> 1. Preventing all postints of running gtk-update-icon-cache by existing
> 2. Running gtk-update-icon-cache ( after postinsts )
> 3. Deleting itself and thereby avoid running during subsequent boots
> and ensuring that packages which are installed later do run
> gtk-update-icon-cache.

The first time something tries this it creates the "lock".
Any subsequent postinstall sees the "lock" and knows not to run.

There are two problems:

a) Knowing these are postinstalls at first boot and not package installs
b) Deleting the unused "lock" files afterwards

You'd therefore probably have to add something to the postinstalls core
which:

a) Creates some file during final rootfs postinstalls on first boot
b) Clears some set of files after first boot.

I don't see a major issue with doing either of these two things though
and it would simplify your patch whilst also allowing other similar
cases to work in a similar way.

Cheers,

Richard





  reply	other threads:[~2012-03-23 23:46 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-22 19:15 [PATCH] gtk-icon-cache.bbclass: Fix multiple rebuilds of the icon cache on first boot Andreas Müller
2012-03-22 19:34 ` Koen Kooi
2012-03-22 19:51   ` Andreas Müller
2012-03-22 20:06     ` Koen Kooi
2012-03-23 12:12 ` Richard Purdie
2012-03-23 22:46   ` Andreas Müller
2012-03-23 23:37     ` Richard Purdie [this message]
2012-03-26  7:39       ` Andreas Müller
2012-03-26  9:19         ` Richard Purdie
2012-03-26 11:43           ` Andreas Müller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1332545863.9740.477.camel@ted \
    --to=richard.purdie@linuxfoundation.org \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.