Jelajahi Sumber

Fix (#10451) - apt::ppa fails to "apt-get update" when new PPA source is added

Matthias Pigulla 12 tahun lalu
induk
melakukan
1be7457
1 mengubah file dengan 4 tambahan dan 7 penghapusan
  1. 4 7
      manifests/ppa.pp

+ 4 - 7
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}.*$'",
+    }
   }
 }