Bugs item #28661, was opened at 2010-10-21 11:01
You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=575&aid=28661&group_id=126

Category: `gem` commands (other)
Group: None
Status: Open
>Resolution: Accepted
Priority: 3
Submitted By: Charles Nutter (headius)
Assigned to: John Barnette (jbarnette)
Summary: gem pristine does not observe installer options

Initial Comment:
In pristine_command.rb, there are the following lines:

      # TODO use installer options
      installer = Gem::Installer.new gem, :wrappers => true, :force => true
      installer.install

Obviously it was intended that this code eventually propagate installer 
options, but it has never been done. Unfortunately rvm's gemset support uses 
"gem pristine --all", which on JRuby will lose the --env-shebang default we 
require to allow using jruby's bash-based startup script in shebang likes for 
installed gem executables. This led to the following bug report: 
http://jira.codehaus.org/browse/JRUBY-5031

After a short exploration, I could not find the proper way to propagate 
installer options for pristine installs, so I ended up going with the following 
patch. RubyGems should be fixed to propagate installer options appropriately.

 diff --git a/lib/ruby/site_ruby/1.8/rubygems/commands/pristine_command.rb 
b/lib/ruby/site_ruby/1.8/rubygems/commands/pristine_command.rb
 index ef11129..61897cc 100644
 --- a/lib/ruby/site_ruby/1.8/rubygems/commands/pristine_command.rb
 +++ b/lib/ruby/site_ruby/1.8/rubygems/commands/pristine_command.rb
 @@ -82,7 +82,11 @@ revert the gem.
        end
  
        # TODO use installer options
 -      installer = Gem::Installer.new gem, :wrappers => true, :force => true
 +      # Modified for JRUBY-5031, to propagate --env-shebang if set
 +      installer = Gem::Installer.new gem,
 +        :wrappers => true,
 +        :force => true,
 +        :env_shebang => 
!Gem::ConfigFile::PLATFORM_DEFAULTS['install'].to_s['--env-shebang'].nil?
        installer.install
  
        say "Restored #{spec.full_name}"


----------------------------------------------------------------------

Comment By: Ryan Davis (zenspider)
Date: 2010-11-12 20:42

Message:
I think this is a dupe. I brought this up a long time ago... but I haven't seen 
the ticket. keeping this one for now. *shrug*

----------------------------------------------------------------------

You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=575&aid=28661&group_id=126
_______________________________________________
Rubygems-developers mailing list
http://rubyforge.org/projects/rubygems
Rubygems-developers@rubyforge.org
http://rubyforge.org/mailman/listinfo/rubygems-developers

Reply via email to