]> gitweb.fluxo.info Git - puppet-apt.git/commitdiff
Fix functions declaration and filenames.
authorintrigeri <intrigeri@boum.org>
Sun, 10 Oct 2010 09:00:18 +0000 (11:00 +0200)
committerintrigeri <intrigeri@boum.org>
Sun, 10 Oct 2010 09:00:18 +0000 (11:00 +0200)
lib/puppet/parser/functions/debian_nextcodename.rb [new file with mode: 0644]
lib/puppet/parser/functions/debian_nextrelease.rb [new file with mode: 0644]
lib/puppet/parser/functions/debian_release.rb
lib/puppet/parser/functions/nextcodename.rb [deleted file]
lib/puppet/parser/functions/nextrelease.rb [deleted file]

diff --git a/lib/puppet/parser/functions/debian_nextcodename.rb b/lib/puppet/parser/functions/debian_nextcodename.rb
new file mode 100644 (file)
index 0000000..37322a2
--- /dev/null
@@ -0,0 +1,11 @@
+module Puppet::Parser::Functions
+  newfunction(:debian_nextcodename, :type => :rvalue) do |args|
+    result = case #{args[0]}
+      when 'etch'    then 'lenny'
+      when 'lenny'   then 'squeeze'
+      when 'squeeze' then 'sid'
+      when 'sid'     then 'experimental'
+    end
+    return result
+  end
+end
diff --git a/lib/puppet/parser/functions/debian_nextrelease.rb b/lib/puppet/parser/functions/debian_nextrelease.rb
new file mode 100644 (file)
index 0000000..62e3234
--- /dev/null
@@ -0,0 +1,11 @@
+module Puppet::Parser::Functions
+  newfunction(:debian_nextrelease, :type => :rvalue) do |args|
+    result = case #{args[0]}
+      when 'oldstable' then 'stable'
+      when 'stable'    then 'testing'
+      when 'testing'   then 'unstable'
+      when 'unstable'  then 'experimental'
+    end
+    return result
+  end
+end
index ef304843fb81b69bd948646ec4fc0a62dc1dbeeb..ec4660107dce6aae810707b5946aab0bc2e10520 100644 (file)
@@ -1,11 +1,12 @@
 module Puppet::Parser::Functions
   newfunction(:debian_release, :type => :rvalue) do |args|
-    case #{args[0]} {
-      etch:         { 'oldstable' }
-      lenny:        { 'stable' }
-      squeeze:      { 'testing' }
-      sid:          { 'unstable' }
-      experimental: { 'experimental' }
-    }
+    result = case #{args[0]}
+      when 'etch'         then 'oldstable'
+      when 'lenny'        then 'stable'
+      when 'squeeze'      then 'testing'
+      when 'sid'          then 'unstable'
+      when 'experimental' then 'experimental'
+    end
+    return result
   end
 end
diff --git a/lib/puppet/parser/functions/nextcodename.rb b/lib/puppet/parser/functions/nextcodename.rb
deleted file mode 100644 (file)
index 3dd592b..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-module Puppet::Parser::Functions
-  newfunction(:debian_nextcodename, :type => :rvalue) do |args|
-    case #{args[0]} {
-      etch:    { 'lenny' }
-      lenny:   { 'squeeze' }
-      squeeze: { 'sid' }
-      sid:     { 'experimental' }
-    }
-  end
-end
diff --git a/lib/puppet/parser/functions/nextrelease.rb b/lib/puppet/parser/functions/nextrelease.rb
deleted file mode 100644 (file)
index 4449121..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-module Puppet::Parser::Functions
-  newfunction(:debian_nextrelease, :type => :rvalue) do |args|
-    case #{args[0]} {
-      oldstable: { 'stable' }
-      stable:    { 'testing' }
-      testing:   { 'unstable' }
-      unstable:  { 'experimental' }
-    }
-  end
-end