gem_install_source_hack.diff

Erik Hetzner, 05/08/2009 11:06 pm

Download (1.7 kB)

lib/puppet/provider/package/gem.rb 2009-05-06 15:37:54.000000000 -0700
78 78
        if source = resource[:source]
79 79
            begin
80 80
                uri = URI.parse(source)
81
                case uri.scheme
82
                when nil: 
83
                    # no URI scheme => interpret the source as a local file
84
                    command << source
85
                when /file/i
86
                    command << uri.path
87
                when 'puppet'
88
                    # we don't support puppet:// URLs (yet)
89
                    raise Puppet::Error.new("puppet:// URLs are not supported as gem sources")              
90
                else
91
                    # interpret it as a gem repository
92
                    command << "--source" << "#{source}" << resource[:name]
93
                end
81 94
            rescue => detail
82
                fail "Invalid source '%s': %s" % [uri, detail]
95
                command = command + source.split(/\s+/)
96
            #    fail "Invalid source '%s': %s" % [uri, detail]
83 97
            end
84 98

  
85
            case uri.scheme
86
            when nil: 
87
                # no URI scheme => interpret the source as a local file
88
                command << source
89
            when /file/i
90
                command << uri.path
91
            when 'puppet'
92
                # we don't support puppet:// URLs (yet)
93
                raise Puppet::Error.new("puppet:// URLs are not supported as gem sources")              
94
            else
95
                # interpret it as a gem repository
96
                command << "--source" << "#{source}" << resource[:name]
97
            end
98 99
        else
99 100
            command << resource[:name]
100 101
        end