2009-10-30 20:20:42 +01:00
|
|
|
define apt::upgrade_package ($version = "") {
|
2010-12-07 19:18:41 +01:00
|
|
|
|
2010-12-15 09:47:57 +01:00
|
|
|
include apt::update
|
|
|
|
|
|
|
|
$version_suffix = $version ? {
|
|
|
|
'' => '',
|
|
|
|
'latest' => '',
|
|
|
|
default => "=${version}",
|
|
|
|
}
|
|
|
|
|
2010-12-15 15:18:16 +01:00
|
|
|
package { ['apt-show-versions', 'dctrl-tools']:
|
|
|
|
ensure => installed,
|
|
|
|
require => undef,
|
|
|
|
}
|
|
|
|
|
2010-12-15 09:47:57 +01:00
|
|
|
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" ],
|
2010-12-15 10:00:47 +01:00
|
|
|
require => [
|
|
|
|
Exec['apt_updated'],
|
|
|
|
Package['apt-show-versions', 'dctrl-tools'],
|
|
|
|
],
|
2009-10-30 20:20:42 +01:00
|
|
|
}
|
2010-12-15 09:47:57 +01:00
|
|
|
|
2009-10-30 20:20:42 +01:00
|
|
|
}
|