2f5d317177
This patch fixes the query used by apt::force to determine rather or not the package is installed. Previously, the expression was not specific enough and could not lead to false positives in cases where a package name is contained within another package name (puppet could be incorrectly determined as being installed if puppet-common is installed) This commit resolves that by improving the query expression.
16 lines
371 B
Puppet
16 lines
371 B
Puppet
# force.pp
|
|
# force a package from a specific release
|
|
|
|
define apt::force(
|
|
$release = 'testing',
|
|
$version = false
|
|
) {
|
|
|
|
exec { "/usr/bin/aptitude -y -t ${release} install ${name}":
|
|
unless => $version ? {
|
|
false => "/usr/bin/dpkg -s ${name} | grep -q 'Status: install'",
|
|
default => "/usr/bin/dpkg -s ${name} | grep -q 'Version: ${version}'"
|
|
}
|
|
}
|
|
|
|
}
|