puppetlabs/puppet — pull request #1633 by jpartlow (2013-05-02 23:08:45+00:00)
Title: (#19785) Package descriptions obtained by rpm/dpkg providers

Previously Puppet::Provider::Package::Rpm and Dpkg implementations
obtained package information from the system without capturing package
description information.

This change modifies the rpm and dpkg-query format strings to include
descriptions.

The rpm implementation is a simple change relying on a SUMMARY field
which is a single line and which does not change the one per package
parsing structure in the Rpm class.

The dpkg implementation is a more complicated change because we are
using a DESCRIPTION field in dpkg-query's format string, which is a
multi-line value. The first line is a summary, and is all we want, but
dpkg-query then print's x additional lines of long description. A new
parse_multi_line method has been added to treat these multi-line results
as a single entry, grab the first line with summary and ignore the
excess lines without triggering warnings. Completely invalid package
entry results should still trigger warnings.

Current dpkg-query versions (as of 1.16.2 from 2012, I believe) have a
binary:Summary field which would return this to a single line parse and
make it simpler and less error prone again. But earlier Debian/Ubuntu
installations don't have this (Ubuntu 12.04 for instance).