Fixup fromcvs/togit conversion
[minix-pkgsrc.git] / lang / ruby193-base / patches / patch-lib_rubygems_config__file.rb
blobd93cad7dec8106a903a030a9009316a83fb619f2
1 $NetBSD: patch-lib_rubygems_config__file.rb,v 1.1.1.1 2011/11/08 16:10:51 taca Exp $
3 Don't hard code config file's path for gem.
5 --- lib/rubygems/config_file.rb.orig    2012-04-19 23:38:41.000000000 +0000
6 +++ lib/rubygems/config_file.rb
7 @@ -47,32 +47,7 @@ class Gem::ConfigFile
8  
9    PLATFORM_DEFAULTS = {}
11 -  system_config_path =
12 -    begin
13 -      require "etc"
14 -      Etc.sysconfdir
15 -    rescue LoadError, NoMethodError
16 -      begin
17 -        # TODO: remove after we drop 1.8.7 and 1.9.1
18 -        require 'Win32API'
20 -        CSIDL_COMMON_APPDATA = 0x0023
21 -        path = 0.chr * 260
22 -        if RUBY_VERSION > '1.9' then
23 -          SHGetFolderPath = Win32API.new 'shell32', 'SHGetFolderPath', 'PLPLP',
24 -          'L', :stdcall
25 -          SHGetFolderPath.call nil, CSIDL_COMMON_APPDATA, nil, 1, path
26 -        else
27 -          SHGetFolderPath = Win32API.new 'shell32', 'SHGetFolderPath', 'LLLLP',
28 -          'L'
29 -          SHGetFolderPath.call 0, CSIDL_COMMON_APPDATA, 0, 1, path
30 -        end
32 -        path.strip
33 -      rescue LoadError
34 -        RbConfig::CONFIG["sysconfdir"] || "/etc"
35 -      end
36 -    end
37 +  system_config_path = '@PKG_SYSCONFDIR@'
39    SYSTEM_WIDE_CONFIG_FILE = File.join system_config_path, 'gemrc'