← Back to team overview

touch-packages team mailing list archive

[Bug 1389257] [NEW] Getting package versions via dpkg-query on startup is very expensive

 

Public bug reported:

The plugin executes dpkg-query on startup to get version numbers of 3
important packages (scopes-api, unity8, self). They are then passed to
Smart Scopes Server with every request. Using dpkg-query at this stage
seems to have big impact on startup time of the Dash (and phone).

Michael Vogt suggested a simple postinst/postrm script that is executed
for all 3 packages to put & update their versions via a flat text file,
e.g.

::::::::::::::
debian/postinst
::::::::::::::
#!/bin/sh

set -e

if [ "$1" = "configure" ]; then
   dpkg-query -W -f'${Version}' $DPKG_MAINTSCRIPT_PACKAGE \
              > /var/lib/unity-scopes-shell/$DPKG_MAINTSCRIPT_PACKAGE
fi::::::::::::::
debian/postrm
::::::::::::::
#!/bin/sh

set -e

rm -f  /var/lib/unity-scopes-shell/$DPKG_MAINTSCRIPT_PACKAGE

** Affects: unity-scopes-shell (Ubuntu)
     Importance: Undecided
         Status: Confirmed

** Changed in: unity-scopes-shell (Ubuntu)
       Status: New => Confirmed

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to unity-scopes-shell in
Ubuntu.
https://bugs.launchpad.net/bugs/1389257

Title:
  Getting package versions via dpkg-query on startup is very expensive

Status in “unity-scopes-shell” package in Ubuntu:
  Confirmed

Bug description:
  The plugin executes dpkg-query on startup to get version numbers of 3
  important packages (scopes-api, unity8, self). They are then passed to
  Smart Scopes Server with every request. Using dpkg-query at this stage
  seems to have big impact on startup time of the Dash (and phone).

  Michael Vogt suggested a simple postinst/postrm script that is
  executed for all 3 packages to put & update their versions via a flat
  text file, e.g.

  ::::::::::::::
  debian/postinst
  ::::::::::::::
  #!/bin/sh

  set -e

  if [ "$1" = "configure" ]; then
     dpkg-query -W -f'${Version}' $DPKG_MAINTSCRIPT_PACKAGE \
                > /var/lib/unity-scopes-shell/$DPKG_MAINTSCRIPT_PACKAGE
  fi::::::::::::::
  debian/postrm
  ::::::::::::::
  #!/bin/sh

  set -e

  rm -f  /var/lib/unity-scopes-shell/$DPKG_MAINTSCRIPT_PACKAGE

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/unity-scopes-shell/+bug/1389257/+subscriptions


Follow ups

References