From: Matthias Pigulla Date: Wed, 2 Nov 2011 14:40:10 +0000 (+0100) Subject: Fix (#10451) - apt::ppa fails to "apt-get update" when new PPA source is added X-Git-Tag: 0.0.1~19^2~1 X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=1be745705cba4f98ab5796756631576a4db67a5f;p=puppet-modules%2Fpuppetlabs-apt.git Fix (#10451) - apt::ppa fails to "apt-get update" when new PPA source is added --- diff --git a/manifests/ppa.pp b/manifests/ppa.pp index af6eebf..a41c814 100644 --- a/manifests/ppa.pp +++ b/manifests/ppa.pp @@ -4,13 +4,6 @@ define apt::ppa() { Class['apt'] -> Apt::Ppa[$title] - Exec { - unless => $name? { - /ppa:(.*)/ => "/bin/cat /etc/apt/sources.list /etc/apt/sources.list.d/* | /bin/egrep '^[^#].*ppa.*$1.*$'", - default => "/bin/cat /etc/apt/sources.list /etc/apt/sources.list.d/* | /bin/egrep '^[^#].*${title}.*$'", - } - } - exec { "apt-update-${name}": command => "/usr/bin/aptitude update", refreshonly => true, @@ -19,6 +12,10 @@ define apt::ppa() { exec { "add-apt-repository-${name}": command => "/usr/bin/add-apt-repository ${name}", notify => Exec["apt-update-${name}"], + unless => $name? { + /ppa:(.*)/ => "/bin/cat /etc/apt/sources.list /etc/apt/sources.list.d/* | /bin/egrep '^[^#].*ppa.*$1.*$'", + default => "/bin/cat /etc/apt/sources.list /etc/apt/sources.list.d/* | /bin/egrep '^[^#].*${title}.*$'", + } } }