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

Bug #1389257 reported by Paweł Stołowski
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Canonical System Image
Fix Released
High
Alejandro J. Cura
unity-scopes-shell (Ubuntu)
Fix Released
High
Paweł Stołowski

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

Related branches

Changed in unity-scopes-shell (Ubuntu):
status: New → Confirmed
Changed in unity-scopes-shell (Ubuntu):
assignee: nobody → Pawel Stolowski (stolowski)
Changed in unity-scopes-shell (Ubuntu):
importance: Undecided → High
Changed in unity-scopes-shell (Ubuntu):
status: Confirmed → In Progress
Changed in canonical-devices-system-image:
importance: Undecided → High
status: New → In Progress
assignee: nobody → kevin gunn (kgunn72)
milestone: none → ww46-2015
kevin gunn (kgunn72)
Changed in canonical-devices-system-image:
assignee: kevin gunn (kgunn72) → Alejandro J. Cura (alecu)
Changed in unity-scopes-shell (Ubuntu):
status: In Progress → Fix Released
Changed in canonical-devices-system-image:
status: In Progress → Fix Committed
Changed in canonical-devices-system-image:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.