[DRE-commits] r5841 - in trunk/libgems-ruby/debian: . patches

Lucas Nussbaum lucas at alioth.debian.org
Sat Sep 11 06:08:00 UTC 2010


Author: lucas
Date: 2010-09-11 06:07:55 +0000 (Sat, 11 Sep 2010)
New Revision: 5841

Modified:
   trunk/libgems-ruby/debian/changelog
   trunk/libgems-ruby/debian/patches/03_disable_update_system.diff
Log:
Provide a way to override Debian's disabling of gem update --system by
setting an environment variable.

Modified: trunk/libgems-ruby/debian/changelog
===================================================================
--- trunk/libgems-ruby/debian/changelog	2010-09-11 05:43:08 UTC (rev 5840)
+++ trunk/libgems-ruby/debian/changelog	2010-09-11 06:07:55 UTC (rev 5841)
@@ -1,8 +1,10 @@
 libgems-ruby (1.3.7-2) unstable; urgency=low
 
   * Drop rubygems for 1.9.1, as it was moved to the ruby1.9.1 source package.
+  * Provide a way to override Debian's disabling of gem update --system by
+    setting an environment variable.
 
- -- Lucas Nussbaum <lucas at lucas-nussbaum.net>  Sat, 11 Sep 2010 07:41:09 +0200
+ -- Lucas Nussbaum <lucas at lucas-nussbaum.net>  Sat, 11 Sep 2010 08:07:37 +0200
 
 libgems-ruby (1.3.7-1) unstable; urgency=low
 

Modified: trunk/libgems-ruby/debian/patches/03_disable_update_system.diff
===================================================================
--- trunk/libgems-ruby/debian/patches/03_disable_update_system.diff	2010-09-11 05:43:08 UTC (rev 5840)
+++ trunk/libgems-ruby/debian/patches/03_disable_update_system.diff	2010-09-11 06:07:55 UTC (rev 5841)
@@ -5,16 +5,16 @@
 ## DP: Disable gem update --system functionality, as it can break things. Users should use apt instead
 
 @DPATCH@
-Index: libgems-ruby/lib/rubygems/commands/update_command.rb
-===================================================================
---- libgems-ruby.orig/lib/rubygems/commands/update_command.rb	2010-04-20 15:47:36.000000000 +0900
-+++ libgems-ruby/lib/rubygems/commands/update_command.rb	2010-07-19 19:22:41.000000000 +0900
-@@ -48,18 +48,7 @@
+--- a/lib/rubygems/commands/update_command.rb
++++ b/lib/rubygems/commands/update_command.rb
+@@ -48,28 +48,32 @@ class Gem::Commands::UpdateCommand < Gem
      hig = {}
  
      if options[:system] then
 -      say "Updating RubyGems"
--
++      if ENV.include?('REALLY_GEM_UPDATE_SYSTEM')
++        say "Updating RubyGems"
+ 
 -      unless options[:args].empty? then
 -        raise "No gem names are allowed with the --system option"
 -      end
@@ -25,7 +25,36 @@
 -      hig['rubygems-update'] = rubygems_update
 -
 -      options[:user_install] = false
-+      fail "gem update --system is disabled on Debian. RubyGems can be updated using the official Debian repositories by aptitude or apt-get."
-     else
-       say "Updating installed gems"
+-    else
+-      say "Updating installed gems"
+-
+-      hig = {} # highest installed gems
++        unless options[:args].empty? then
++          raise "No gem names are allowed with the --system option"
++        end
  
+-      Gem.source_index.each do |name, spec|
+-        if hig[spec.name].nil? or hig[spec.name].version < spec.version then
+-          hig[spec.name] = spec
++        rubygems_update = Gem::Specification.new
++        rubygems_update.name = 'rubygems-update'
++        rubygems_update.version = Gem::Version.new Gem::VERSION
++        hig['rubygems-update'] = rubygems_update
++
++        options[:user_install] = false
++      else
++        say "Updating installed gems"
++
++        hig = {} # highest installed gems
++
++        Gem.source_index.each do |name, spec|
++          if hig[spec.name].nil? or hig[spec.name].version < spec.version then
++            hig[spec.name] = spec
++          end
+         end
+       end
++    else
++      fail "gem update --system is disabled on Debian, because it will overwrite the content of the rubygems Debian package, and might break your Debian system in subtle ways. The Debian-supported way to update rubygems is through apt-get, using Debian official repositories.\nIf you really know what you are doing, you can still update rubygems by setting the REALLY_GEM_UPDATE_SYSTEM environment variable, but please remember that this is completely unsupported by Debian."
+     end
+ 
+     gems_to_update = which_to_update hig, options[:args]




More information about the Pkg-ruby-extras-commits mailing list