Starting to clean up init.pp
[puppet-modules/puppetlabs-apt.git] / manifests / builddep.pp
index 8aebc679aea3329223b293d41fe3654dff91c5ff..3a059c273d389751da4359e1d2f38e6c6a9e27de 100644 (file)
@@ -1,16 +1,16 @@
 # builddep.pp
 
 define apt::builddep() {
+  include apt::update
 
-  Class['apt'] -> Apt::Builddep[$name]
-
-  exec { "apt-update-${name}":
-    command     => "/usr/bin/apt-get update",
-    refreshonly => true,
+  exec { "apt-builddep-${name}":
+    command   => "/usr/bin/apt-get -y --force-yes build-dep ${name}",
+    logoutput => 'on_failure',
+    require   => Exec['apt_update'],
   }
 
-  exec { "apt-builddep-${name}":
-    command     => "/usr/bin/apt-get -y --force-yes build-dep $name",
-    notify      => Exec["apt-update-${name}"],
+  # Need anchor to provide containment for dependencies.
+  anchor { "apt::builddep::${name}":
+    require => Class['apt::update'],
   }
 }