Merge pull request #215 from lotherk/proxy_val_no_boolean
[puppet-modules/puppetlabs-apt.git] / manifests / pin.pp
index e6e293e45260db337f3b2d80f4fe2fc74f8bd4d5..9cb4a8e798ba5ef3a0e1caa05275e5ba53137201 100644 (file)
@@ -14,7 +14,7 @@ define apt::pin(
   $release_version = '', # v=
   $component       = '', # c=
   $originator      = '', # o=
-  $label           = '', # l=
+  $label           = ''  # l=
 ) {
 
   include apt::params
@@ -25,18 +25,25 @@ define apt::pin(
     fail('Only integers are allowed in the apt::pin order param')
   }
 
-  $pin_release = join([
+  $pin_release_array = [
     $release,
     $codename,
     $release_version,
     $component,
     $originator,
-    $label], '')
+    $label]
+  $pin_release = join($pin_release_array, '')
 
   # Read the manpage 'apt_preferences(5)', especially the chapter
   # 'Thea Effect of APT Preferences' to understand the following logic
   # and the difference between specific and general form
-  if $packages != '*' { # specific form
+  if is_array($packages) {
+    $packages_string = join($packages, ' ')
+  } else {
+    $packages_string = $packages
+  }
+
+  if $packages_string != '*' { # specific form
 
     if ( $pin_release != '' and ( $origin != '' or $version != '' )) or
       ( $origin != '' and ( $pin_release != '' or $version != '' )) or