File tree Expand file tree Collapse file tree 2 files changed +25
-15
lines changed Expand file tree Collapse file tree 2 files changed +25
-15
lines changed Original file line number Diff line number Diff line change 66
77 confine :true => Facter . value ( :aio_agent_version )
88
9- def self . windows_gemcmd
10- puppet_dir = Puppet ::Util . get_env ( 'PUPPET_DIR' )
11- if puppet_dir
12- File . join ( Puppet ::Util . get_env ( 'PUPPET_DIR' ) . to_s , 'bin' , 'gem.bat' )
13- else
14- File . join ( Gem . default_bindir , 'gem.bat' )
15- end
16- end
17-
18- if Puppet ::Util ::Platform . windows?
19- commands :gemcmd => windows_gemcmd
20- else
21- commands :gemcmd => "/opt/puppetlabs/puppet/bin/gem"
22- end
9+ commands :gemcmd => Puppet . run_mode . gem_cmd
2310
2411 def uninstall
2512 super
@@ -28,7 +15,9 @@ def uninstall
2815 end
2916
3017 def self . execute_gem_command ( command , command_options , custom_environment = { } )
31- custom_environment [ 'PKG_CONFIG_PATH' ] = '/opt/puppetlabs/puppet/lib/pkgconfig' unless Puppet ::Util ::Platform . windows?
18+ if ( pkg_config_path = Puppet . run_mode . pkg_config_path )
19+ custom_environment [ 'PKG_CONFIG_PATH' ] = pkg_config_path
20+ end
3221 super ( command , command_options , custom_environment )
3322 end
3423end
Original file line number Diff line number Diff line change @@ -85,6 +85,14 @@ def run_dir
8585 def log_dir
8686 which_dir ( "/var/log/puppetlabs/puppet" , "~/.puppetlabs/var/log" )
8787 end
88+
89+ def pkg_config_path
90+ '/opt/puppetlabs/puppet/lib/pkgconfig'
91+ end
92+
93+ def gem_cmd
94+ '/opt/puppetlabs/puppet/bin/gem'
95+ end
8896 end
8997
9098 class WindowsRunMode < RunMode
@@ -112,6 +120,19 @@ def log_dir
112120 which_dir ( File . join ( windows_common_base ( "puppet/var/log" ) ) , "~/.puppetlabs/var/log" )
113121 end
114122
123+ def pkg_config_path
124+ nil
125+ end
126+
127+ def gem_cmd
128+ puppet_dir = Puppet ::Util . get_env ( 'PUPPET_DIR' )
129+ if puppet_dir
130+ File . join ( Puppet ::Util . get_env ( 'PUPPET_DIR' ) . to_s , 'bin' , 'gem.bat' )
131+ else
132+ File . join ( Gem . default_bindir , 'gem.bat' )
133+ end
134+ end
135+
115136 private
116137
117138 def windows_common_base ( *extra )
You can’t perform that action at this time.
0 commit comments