2009-10-30 20:20:42 +01:00
|
|
|
define apt::upgrade_package ($version = "") {
|
2010-12-07 19:18:41 +01:00
|
|
|
|
2009-10-30 20:20:42 +01:00
|
|
|
case $version {
|
2010-12-14 21:39:50 +01:00
|
|
|
'', 'latest': {
|
2010-12-14 22:04:05 +01:00
|
|
|
exec { "/usr/bin/apt-get update && aptitude -y install $name":
|
2009-10-30 20:20:42 +01:00
|
|
|
onlyif => [ "grep-status -F Status installed -a -P $name -q", "apt-show-versions -u $name | grep -q upgradeable" ],
|
|
|
|
}
|
|
|
|
}
|
|
|
|
default: {
|
2010-12-14 22:04:05 +01:00
|
|
|
exec { "/usr/bin/apt-get update && aptitude -y install $name=$version":
|
2009-10-30 20:20:42 +01:00
|
|
|
onlyif => [ "grep-status -F Status installed -a -P $name -q", "apt-show-versions -u $name | grep -q upgradeable" ],
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|