package_resource script is outdated

Bug #1184197 reported by Sylvain Pineau
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Checkbox
Fix Released
Low
Sylvain Pineau

Bug Description

package_resource is outdated

1) packages states/flags definition is out-of-date in the script (precise+)
2) dpkg -l returns a new architecture column by default (quantal+)

1) is a minor issue but 2) removes the description field content by the arch value.

[Expected result]

name: zlib1g
version: 1:1.2.7.dfsg-13ubuntu2
description: compression library - runtime
desired: Install
status: Installed

[Actual result]

version: 1:1.2.7.dfsg-13ubuntu2
status: Installed
desired: Install
name: zlib1g:amd64
description: amd64

Related branches

Revision history for this message
Sylvain Pineau (sylvain-pineau) wrote :

1) is pretty easy to fix, the packages states, selection states and flags just need to be updated from the dpkg man page.

To solve 2) I would suggest to use dpkg-query directly to select the field that we need.

Changed in checkbox:
importance: Undecided → Low
status: New → Triaged
assignee: nobody → Sylvain Pineau (sylvain-pineau)
status: Triaged → In Progress
Revision history for this message
Sylvain Pineau (sylvain-pineau) wrote :

dpkg-query cannot be used for precise, support for virtual output binary:Summary and db:Status-Abbrev fields is only available since dpkg 1.16.2 (See https://launchpad.net/ubuntu/+source/dpkg/1.16.3ubuntu1).

Only an hybrid version could work for all releases, the current parser for precise using 'dpkg -l' and a new one using dpkg-query for quantal+.

Revision history for this message
Sylvain Pineau (sylvain-pineau) wrote :

the proposed fix is only relying on dpkg-query:

dpkg-query -W -f='name: ${Package}\nversion: ${Version}\n\n'

This command works for all versions and remove the need of having a dedicated script to create this resource.

Daniel Manrique (roadmr)
Changed in checkbox:
status: In Progress → Fix Committed
Changed in checkbox:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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