From 1be745705cba4f98ab5796756631576a4db67a5f Mon Sep 17 00:00:00 2001 From: Matthias Pigulla Date: Wed, 2 Nov 2011 15:40:10 +0100 Subject: [PATCH] Fix (#10451) - apt::ppa fails to "apt-get update" when new PPA source is added --- manifests/ppa.pp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) 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}.*$'", + } } } -- 2.45.2