Mageia Bugzilla – Attachment 2780 Details for
Bug 7429
[PATCH] gem_helper.rb is broken
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
New Account
|
Forgot Password
[patch]
Patch to fix the problem.
gem_helper.patch (text/plain), 2.17 KB, created by
Shlomi Fish
on 2012-09-10 16:02:03 CEST
(
hide
)
Description:
Patch to fix the problem.
Filename:
MIME Type:
Creator:
Shlomi Fish
Created:
2012-09-10 16:02:03 CEST
Size:
2.17 KB
patch
obsolete
>--- gem_helper.rb.orig 2012-09-10 16:05:54.653821721 +0300 >+++ gem_helper.rb 2012-09-10 16:38:47.375989977 +0300 >@@ -57,10 +57,8 @@ > argv.delete_at(0) > end > >- file_data = Zlib::GzipReader.open("metadata.gz") >- header = YAML::load(file_data) >- file_data.close() >- body = header.instance_variable_get :@ivars >+ file_data = Zlib::GzipReader.open("metadata.gz") { |gz| gz.read() } >+ header = YAML.load(file_data) > > require 'rubygems' > spec = Gem::Specification.from_yaml(YAML.dump(header)) >@@ -79,7 +77,7 @@ > end > end > >- if body['extensions'].size > 0 >+ if header.extensions.size > 0 > require 'rubygems/ext' > module Gem::Ext > class Builder >@@ -121,22 +119,22 @@ > unless dry_run > Gem::Installer.new(spec).build_extensions > else >- for ext in body['extensions'] >+ for ext in header.extensions > files.push(ext[0..ext.rindex("/")-1]+".so") > end > end > >- body['extensions'].clear() >+ header.extensions.clear() > end > if ARGV[0] == "build" >- body['test_files'].clear() >+ header.test_files.clear() > > # We don't want ext/ in require_paths, it will only contain content for > # building extensions which needs to be installed in sitearchdir anyways.. > idx = 0 >- for i in 0..body['require_paths'].size()-1 >- if body['require_paths'][idx].match("^ext(/|$)") >- body['require_paths'].delete_at(idx) >+ for i in 0..header.require_paths.size()-1 >+ if header.require_paths[idx].match("^ext(/|$)") >+ header.require_paths.delete_at(idx) > else > idx += 1 > end >@@ -144,19 +142,19 @@ > > # We'll get rid of all the files we don't really need to install > idx = 0 >- for i in 0..body['files'].size()-1 >- if filter and body['files'][idx].match(filter) >+ for i in 0..header.files.size()-1 >+ if filter and header.files[idx].match(filter) > match = true > else > match = false >- for path in body['require_paths'] >- if body['files'][idx].match("^%s/" % path) >+ for path in header.require_paths >+ if header.files[idx].match("^%s/" % path) > match = true > end > end > end > if !match >- body['files'].delete_at(idx) >+ header.files.delete_at(idx) > else > idx += 1 > end
--- gem_helper.rb.orig 2012-09-10 16:05:54.653821721 +0300 +++ gem_helper.rb 2012-09-10 16:38:47.375989977 +0300 @@ -57,10 +57,8 @@ argv.delete_at(0) end - file_data = Zlib::GzipReader.open("metadata.gz") - header = YAML::load(file_data) - file_data.close() - body = header.instance_variable_get :@ivars + file_data = Zlib::GzipReader.open("metadata.gz") { |gz| gz.read() } + header = YAML.load(file_data) require 'rubygems' spec = Gem::Specification.from_yaml(YAML.dump(header)) @@ -79,7 +77,7 @@ end end - if body['extensions'].size > 0 + if header.extensions.size > 0 require 'rubygems/ext' module Gem::Ext class Builder @@ -121,22 +119,22 @@ unless dry_run Gem::Installer.new(spec).build_extensions else - for ext in body['extensions'] + for ext in header.extensions files.push(ext[0..ext.rindex("/")-1]+".so") end end - body['extensions'].clear() + header.extensions.clear() end if ARGV[0] == "build" - body['test_files'].clear() + header.test_files.clear() # We don't want ext/ in require_paths, it will only contain content for # building extensions which needs to be installed in sitearchdir anyways.. idx = 0 - for i in 0..body['require_paths'].size()-1 - if body['require_paths'][idx].match("^ext(/|$)") - body['require_paths'].delete_at(idx) + for i in 0..header.require_paths.size()-1 + if header.require_paths[idx].match("^ext(/|$)") + header.require_paths.delete_at(idx) else idx += 1 end @@ -144,19 +142,19 @@ # We'll get rid of all the files we don't really need to install idx = 0 - for i in 0..body['files'].size()-1 - if filter and body['files'][idx].match(filter) + for i in 0..header.files.size()-1 + if filter and header.files[idx].match(filter) match = true else match = false - for path in body['require_paths'] - if body['files'][idx].match("^%s/" % path) + for path in header.require_paths + if header.files[idx].match("^%s/" % path) match = true end end end if !match - body['files'].delete_at(idx) + header.files.delete_at(idx) else idx += 1 end
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 7429
: 2780