From: intrigeri Date: Tue, 14 Dec 2010 21:04:05 +0000 (+0100) Subject: (ugly workaround warning) Update packages lists before upgrading a package. X-Git-Url: https://gitweb.fluxo.info/?a=commitdiff_plain;h=4979889584b2b150e43f9930f5eccbf6cf5245fa;p=puppet-apt.git (ugly workaround warning) Update packages lists before upgrading a package. ... because Exec[update_apt] is currently never run since we set it refreshonly. Better solutions are being thought of, but in the meantime the least we can do is somehow repair apt::upgrade_package. --- diff --git a/manifests/upgrade_package.pp b/manifests/upgrade_package.pp index ecdd74f..7656a9b 100644 --- a/manifests/upgrade_package.pp +++ b/manifests/upgrade_package.pp @@ -2,12 +2,12 @@ define apt::upgrade_package ($version = "") { case $version { '', 'latest': { - exec { "aptitude -y install $name": + exec { "/usr/bin/apt-get update && 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": + exec { "/usr/bin/apt-get update && aptitude -y install $name=$version": onlyif => [ "grep-status -F Status installed -a -P $name -q", "apt-show-versions -u $name | grep -q upgradeable" ], } }