Fix apt::upgrade_package when used multiple times.

This commit is contained in:
intrigeri 2010-12-16 18:14:23 +01:00
parent bbe2c8aee9
commit 575e4ab9cc

View file

@ -8,10 +8,19 @@ define apt::upgrade_package ($version = "") {
default => "=${version}",
}
package { ['apt-show-versions', 'dctrl-tools']:
if !defined(Package['apt-show-versions']) {
package { 'apt-show-versions':
ensure => installed,
require => undef,
}
}
if !defined(Package['dctrl-tools']) {
package { 'dctrl-tools':
ensure => installed,
require => undef,
}
}
exec { "aptitude -y install ${name}${version_suffix}":
onlyif => [ "grep-status -F Status installed -a -P $name -q", "apt-show-versions -u $name | grep -q upgradeable" ],