[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, upstream, updated. 0.25.5-639-g8f94f35

test branch puppet-dev at googlegroups.com
Wed Jul 14 10:33:16 UTC 2010


The following commit has been merged in the upstream branch:
commit 71033786bf4abef4fd486793d6fe186fff87a432
Author: Jesse Wolfe <jes5199 at gmail.com>
Date:   Thu Apr 15 16:43:27 2010 -0700

    feature #2276 Single Executable: legacy settings
    
    Puppet's defaults change depending on which command invokes them.
    This patch makes sure that we use the maintain the current behavior.
    This is a temporary fix until I implement feature #2935.
    
    Signed-off-by: Jesse Wolfe <jes5199 at gmail.com>

diff --git a/bin/puppet b/bin/puppet
index 2f497c5..bf4ee3a 100755
--- a/bin/puppet
+++ b/bin/puppet
@@ -8,13 +8,13 @@ usage = "Usage: puppet command <space separated arguments>"
 available = "Available commands are: #{builtins.sort.join(', ')}"
 
 require 'puppet/util/command_line'
-command_line = Puppet::Util::CommandLine.shift_subcommand_from_argv
+$puppet_subcommand_name = Puppet::Util::CommandLine.shift_subcommand_from_argv
 
-if command_name.nil?
+if $puppet_subcommand_name.nil?
     puts usage, available
-elsif builtins.include?(command_name) #subcommand
-    require File.join(appdir, command_name)
-    Puppet::Application[command_name].run
+elsif builtins.include?($puppet_subcommand_name) #subcommand
+    require File.join(appdir, $puppet_subcommand_name)
+    Puppet::Application[$puppet_subcommand_name].run
 else
-    abort "Error: Unknown command #{command_name}.\n#{usage}\n#{available}"
+    abort "Error: Unknown command #{$puppet_subcommand_name}.\n#{usage}\n#{available}"
 end
diff --git a/lib/puppet/defaults.rb b/lib/puppet/defaults.rb
index 1f5e0ed..a9cb484 100644
--- a/lib/puppet/defaults.rb
+++ b/lib/puppet/defaults.rb
@@ -4,7 +4,20 @@ module Puppet
     # use basedirs that are in the user's home directory.
     conf = nil
     var = nil
-    name = $0.gsub(/.+#{File::SEPARATOR}/,'').sub(/\.rb$/, '')
+
+    legacy_name = Hash.new{ |h,k| k }.update({
+        'agent'      => 'puppetd',
+        'cert'       => 'puppetca',
+        'doc'        => 'puppetdoc',
+        'filebucket' => 'filebucket',
+        'apply'      => 'puppet',
+        'describe'   => 'pi',
+        'queue'      => 'puppetqd',
+        'resource'   => 'ralsh',
+        'kick'       => 'puppetrun',
+        'master'     => 'puppetmasterd',
+    })
+    name = legacy_name[ $puppet_subcommand_name ] || $0.gsub(/.+#{File::SEPARATOR}/,'').sub(/\.rb$/, '')
 
     # Make File.expand_path happy
     require 'etc'

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list