summaryrefslogtreecommitdiff
path: root/manifests/upgrade_package.pp
diff options
context:
space:
mode:
authornadir <nadir-technik@nadir.org>2010-10-09 11:49:05 +0200
committernadir <nadir-technik@nadir.org>2010-10-09 11:49:05 +0200
commit49f17e56eb295fe31b06635c35db0b264bbaca5c (patch)
treee2d16790a629a60b5550f10ecdb2974041c981d8 /manifests/upgrade_package.pp
parent5952611119d839eea1e4b39be1c89fa2e5cae502 (diff)
parent521ccfec19d40fa5d78162727afa26c15778c173 (diff)
merge with immerda master
Diffstat (limited to 'manifests/upgrade_package.pp')
-rw-r--r--manifests/upgrade_package.pp19
1 files changed, 19 insertions, 0 deletions
diff --git a/manifests/upgrade_package.pp b/manifests/upgrade_package.pp
new file mode 100644
index 0000000..41d5d52
--- /dev/null
+++ b/manifests/upgrade_package.pp
@@ -0,0 +1,19 @@
+define apt::upgrade_package ($version = "") {
+ case $version {
+ '': {
+ exec { "aptitude -y install $name":
+ onlyif => [ "grep-status -F Status installed -a -P $name -q", "apt-show-versions -u $name | grep -q upgradeable" ],
+ }
+ }
+ 'latest': {
+ exec { "aptitude -y install $name":
+ onlyif => [ "grep-status -F Status installed -a -P $name -q", "apt-show-versions -u $name | grep -q upgradeable" ],
+ }
+ }
+ default: {
+ exec { "aptitude -y install $name=$version":
+ onlyif => [ "grep-status -F Status installed -a -P $name -q", "apt-show-versions -u $name | grep -q upgradeable" ],
+ }
+ }
+ }
+}