[DRE-commits] [gem2deb] 01/01: Drop Ruby 1.8 support

Antonio Terceiro terceiro at alioth.debian.org
Thu Aug 8 19:53:10 UTC 2013


This is an automated email from the git hooks/post-receive script.

terceiro pushed a commit to branch master
in repository gem2deb.

commit 50babdfe6614cd9ea61250a5467b3e847fa9e3e1
Author: Antonio Terceiro <terceiro at debian.org>
Date:   Thu Aug 8 21:51:30 2013 +0200

    Drop Ruby 1.8 support
    
    I am satisfied that the changes needed under lib/ were fairly minimal.
---
 TODO                                           |   10 +---------
 bin/dh-make-ruby                               |    2 +-
 bin/dh_ruby                                    |    3 +--
 bin/dh_ruby_fixdepends                         |    2 +-
 debian/control                                 |    4 ++--
 debian/rules                                   |    1 -
 lib/gem2deb.rb                                 |    2 --
 lib/gem2deb/dh_make_ruby/template/debian/rules |    2 +-
 lib/gem2deb/installer.rb                       |   24 +++++------------------
 test/sample/multibinary/debian/rules           |    2 +-
 test/sample/name_clash_multiple/debian/rules   |    2 +-
 test/sample/simpleprogram/bin/simpleprogram    |    2 +-
 test/test_helper.rb                            |    1 -
 test/unit/dh_ruby_test.rb                      |   25 ------------------------
 test/unit/installer_test.rb                    |   10 ++++++----
 test/unit/setup_rb_installer_test.rb           |    1 -
 16 files changed, 21 insertions(+), 72 deletions(-)

diff --git a/TODO b/TODO
index 443c944..e443296 100644
--- a/TODO
+++ b/TODO
@@ -1,18 +1,10 @@
 These enhancement ideas are listed in no particular order.
 
-
-use ruby1.9.1 by default
-========================
-
-Currently we build packages for both 1.8 and 1.9.1, but 1.8 is still considered
-to be the "default version". As soon as Debian switches to 1.9.1 being the
-default, gem2deb should do so as well.
-
 do not stop running tests after the first failing test suite
 ============================================================
 
 Currently dh_ruby will stop after the first test suite fails, i.e. if the test
-suite fails under ruby 1.8, it will not run under ruby 1.9. Instead, dh_ruby
+suite fails under ruby 1.9.1, it will not run under ruby 2.0. Instead, dh_ruby
 should run all tests, and fail if any of them fail, but still run all of them.
 
 dh_ruby: solve the --install X the world situation
diff --git a/bin/dh-make-ruby b/bin/dh-make-ruby
index 83c4635..0f1d5a4 100755
--- a/bin/dh-make-ruby
+++ b/bin/dh-make-ruby
@@ -85,7 +85,7 @@ Ruby versions to build the package for. This is used to generate the
 X-Ruby-Versions: field in the source package, that can later be used to tune
 this value.  By default, gem2deb generates a package that works on all known
 Ruby versions, but it might be necessary to only build the package for Ruby
-1.8, for example (using B<--ruby-versions "ruby1.8">).
+1.9.1, for example (using B<--ruby-versions "ruby1.9.1">).
 
 =item B<-h>, B<--help>
 
diff --git a/bin/dh_ruby b/bin/dh_ruby
index 407131d..73892c5 100755
--- a/bin/dh_ruby
+++ b/bin/dh_ruby
@@ -212,8 +212,7 @@ first !
 
 This is a space-separated list of tests that dh_ruby will ignore during package
 build. The available test names are "require-rubygems" plus the names of all
-supported Ruby versions. At the time of writing, only "ruby1.8" and "ruby1.9.1"
-are supported.
+supported Ruby versions. At the time of writing, only "ruby1.9.1" is supported.
 
 If set to "all", all tests will be ignored during the package build.
 
diff --git a/bin/dh_ruby_fixdepends b/bin/dh_ruby_fixdepends
index e0ed278..b0a3494 100755
--- a/bin/dh_ruby_fixdepends
+++ b/bin/dh_ruby_fixdepends
@@ -29,7 +29,7 @@ include Gem2Deb
       std_deps = []
       ruby_deps = []
       deps.each do |dep|
-        if ['libruby1.8', 'libruby1.9.1'].include?(dep.split(' ')[0])
+        if ['libruby1.9.1'].include?(dep.split(' ')[0])
           ruby_deps << dep
         else
           std_deps << dep
diff --git a/debian/control b/debian/control
index 2356c9f..e65c067 100644
--- a/debian/control
+++ b/debian/control
@@ -6,14 +6,14 @@ Uploaders: Lucas Nussbaum <lucas at debian.org>,
            Antonio Terceiro <terceiro at debian.org>,
            Vincent Fourmond <fourmond at debian.org>,
 	   Gunnar Wolf <gwolf at debian.org>
-Build-Depends: debhelper (>= 7.0.50~), rake, ruby-shoulda-context, ruby-mocha, rubygems (>= 1.8.12-1~), ruby1.8, ruby1.8-dev, ruby1.9.1 (>= 1.9.3.0-1~), ruby1.9.1-dev (>= 1.9.3.0-1~), devscripts, ruby-setup, lintian
+Build-Depends: debhelper (>= 7.0.50~), rake, ruby-shoulda-context, ruby-mocha, ruby1.9.1 (>= 1.9.3.0-1~), ruby1.9.1-dev (>= 1.9.3.0-1~), devscripts, ruby-setup, lintian
 Standards-Version: 3.9.4
 Vcs-Git: git://anonscm.debian.org/pkg-ruby-extras/gem2deb.git
 Vcs-Browser: http://anonscm.debian.org/gitweb?p=pkg-ruby-extras/gem2deb.git;a=summary
 
 Package: gem2deb
 Architecture: all
-Depends: ruby | ruby-interpreter, ruby1.8, rubygems (>= 1.8.12-1~), ruby1.8-dev, ruby1.9.1 (>= 1.9.3.0-1~), ruby1.9.1-dev (>= 1.9.3.0-1~), build-essential, devscripts, debhelper (>= 7.0.50~), ${perl:Depends}, ${shlibs:Depends}, ${misc:Depends}
+Depends: ruby | ruby-interpreter, ruby1.9.1 (>= 1.9.3.0-1~), ruby1.9.1-dev (>= 1.9.3.0-1~), build-essential, devscripts, debhelper (>= 7.0.50~), ${perl:Depends}, ${shlibs:Depends}, ${misc:Depends}
 Description: Debian Ruby packaging suite
  gem2deb is a set of tools to create Debian package from ruby software
  distributed with Rubygems. gem2tgz converts the .gem file to a tar archive,
diff --git a/debian/rules b/debian/rules
index 6bf329d..cf75b2d 100755
--- a/debian/rules
+++ b/debian/rules
@@ -6,7 +6,6 @@
 override_dh_auto_build:
 ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
 	# NO_PKG_MANGLE=1 is only useful on Ubuntu buildds, to disable pkgbinarymangler
-	NO_PKG_MANGLE=1 ruby1.8		-S rake test
 	NO_PKG_MANGLE=1 ruby1.9.1	-S rake test
 endif
 	mkdir -p man
diff --git a/lib/gem2deb.rb b/lib/gem2deb.rb
index 2647733..b8c9214 100644
--- a/lib/gem2deb.rb
+++ b/lib/gem2deb.rb
@@ -25,12 +25,10 @@ module Gem2Deb
   SUPPORTED_RUBY_VERSIONS = {
     #name             Ruby binary
     #---------------  -------------------
-    'ruby1.8'   => '/usr/bin/ruby1.8',
     'ruby1.9.1' => '/usr/bin/ruby1.9.1',
   }
 
   RUBY_CONFIG_VERSION = {
-    'ruby1.8'   => '1.8',
     'ruby1.9.1' => '1.9.1',
   }
 
diff --git a/lib/gem2deb/dh_make_ruby/template/debian/rules b/lib/gem2deb/dh_make_ruby/template/debian/rules
index a5e7dc8..ded0259 100644
--- a/lib/gem2deb/dh_make_ruby/template/debian/rules
+++ b/lib/gem2deb/dh_make_ruby/template/debian/rules
@@ -6,7 +6,7 @@
 #
 # Uncomment to ignore some test failures (but the tests will run anyway).
 # Valid values:
-#export DH_RUBY_IGNORE_TESTS=ruby1.8 ruby1.9.1 require-rubygems
+#export DH_RUBY_IGNORE_TESTS=ruby1.9.1 require-rubygems
 #
 # If you need to specify the .gemspec (eg there is more than one)
 #export DH_RUBY_GEMSPEC=gem.gemspec
diff --git a/lib/gem2deb/installer.rb b/lib/gem2deb/installer.rb
index 7034844..5531818 100644
--- a/lib/gem2deb/installer.rb
+++ b/lib/gem2deb/installer.rb
@@ -45,7 +45,6 @@ module Gem2Deb
         end
       end
 
-      install_symlinks
       install_changelog
     end
 
@@ -117,7 +116,11 @@ module Gem2Deb
     protected
 
     def all_ruby_versions_supported?
-      ruby_versions == SUPPORTED_RUBY_VERSIONS.keys
+      ruby_versions == supported_ruby_versions
+    end
+
+    def supported_ruby_versions
+      SUPPORTED_RUBY_VERSIONS.keys
     end
 
     def bindir
@@ -186,23 +189,6 @@ module Gem2Deb
       end
     end
 
-
-    def install_symlinks
-      ruby_versions.select { |v| v == 'ruby1.8' }.each do |rubyver|
-        archdir = destdir(:archdir, rubyver)
-        vendordir = destdir(:libdir, rubyver)
-        vendorlibdir = File.dirname(archdir)
-        Dir.glob(File.join(archdir, '*.so')).each do |so|
-          rb = File.basename(so).gsub(/\.so$/, '.rb')
-          if File.exists?(File.join(vendordir, rb))
-            Dir.chdir(vendorlibdir) do
-              file_handler.ln_s "../#{rb}", rb
-            end
-          end
-        end
-      end
-    end
-
     def remove_duplicate_files(src, dst)
       candidates = Dir::entries(src) - ['.', '..']
       candidates.each do |cand|
diff --git a/test/sample/multibinary/debian/rules b/test/sample/multibinary/debian/rules
index a5e7dc8..ded0259 100755
--- a/test/sample/multibinary/debian/rules
+++ b/test/sample/multibinary/debian/rules
@@ -6,7 +6,7 @@
 #
 # Uncomment to ignore some test failures (but the tests will run anyway).
 # Valid values:
-#export DH_RUBY_IGNORE_TESTS=ruby1.8 ruby1.9.1 require-rubygems
+#export DH_RUBY_IGNORE_TESTS=ruby1.9.1 require-rubygems
 #
 # If you need to specify the .gemspec (eg there is more than one)
 #export DH_RUBY_GEMSPEC=gem.gemspec
diff --git a/test/sample/name_clash_multiple/debian/rules b/test/sample/name_clash_multiple/debian/rules
index a5e7dc8..ded0259 100755
--- a/test/sample/name_clash_multiple/debian/rules
+++ b/test/sample/name_clash_multiple/debian/rules
@@ -6,7 +6,7 @@
 #
 # Uncomment to ignore some test failures (but the tests will run anyway).
 # Valid values:
-#export DH_RUBY_IGNORE_TESTS=ruby1.8 ruby1.9.1 require-rubygems
+#export DH_RUBY_IGNORE_TESTS=ruby1.9.1 require-rubygems
 #
 # If you need to specify the .gemspec (eg there is more than one)
 #export DH_RUBY_GEMSPEC=gem.gemspec
diff --git a/test/sample/simpleprogram/bin/simpleprogram b/test/sample/simpleprogram/bin/simpleprogram
index df87ad3..2c74f20 100644
--- a/test/sample/simpleprogram/bin/simpleprogram
+++ b/test/sample/simpleprogram/bin/simpleprogram
@@ -1,3 +1,3 @@
-#!/usr/bin/env ruby1.8
+#!/usr/bin/env ruby1.9.1
 
 puts "I am a simple program"
diff --git a/test/test_helper.rb b/test/test_helper.rb
index 3658a58..135eff1 100644
--- a/test/test_helper.rb
+++ b/test/test_helper.rb
@@ -9,7 +9,6 @@ Gem2DebTestCase = Test::Unit::TestCase
 class Gem2DebTestCase
 
   VENDOR_ARCH_DIRS = {
-    'ruby1.8'   => `ruby1.8   -rrbconfig -e "puts RbConfig::CONFIG['vendorarchdir']"`.strip,
     'ruby1.9.1' => `ruby1.9.1 -rrbconfig -e "puts RbConfig::CONFIG['vendorarchdir']"`.strip,
   }
 
diff --git a/test/unit/dh_ruby_test.rb b/test/unit/dh_ruby_test.rb
index 3c20708..6645ecd 100644
--- a/test/unit/dh_ruby_test.rb
+++ b/test/unit/dh_ruby_test.rb
@@ -32,7 +32,6 @@ class DhRubyTest < Gem2DebTestCase
 
   context 'installing native extension' do
     [
-      '1.8',
       '1.9.1',
     ].each do |version_number|
       vendorarchdir = VENDOR_ARCH_DIRS['ruby' + version_number]
@@ -49,7 +48,6 @@ class DhRubyTest < Gem2DebTestCase
 
   context 'installing native extension with extconf.rb in the sources root' do
     [
-      '1.8',
       '1.9.1',
     ].each do |version_number|
       vendorarchdir = VENDOR_ARCH_DIRS['ruby' + version_number]
@@ -99,29 +97,6 @@ class DhRubyTest < Gem2DebTestCase
     end
   end
 
-  context 'libraries with name clash (between foo.rb and foo.so)' do
-    should "install symlinks for foo.rb in Ruby 1.8 vendorlibdir" do
-      symlink = installed_file_path(SIMPLE_EXTENSION_WITH_NAME_CLASH_DIRNAME, 'ruby-simpleextension-with-name-clash', "/usr/lib/ruby/vendor_ruby/1.8/simpleextension_with_name_clash.rb")
-      assert_file_exists symlink
-    end
-    should 'not install symlink for foo.rb in Ruby 1.9 vendorlibdir' do
-      symlink = installed_file_path(SIMPLE_EXTENSION_WITH_NAME_CLASH_DIRNAME, 'ruby-simpleextension-with-name-clash', "/usr/lib/ruby/vendor_ruby/1.9.1/simpleextension_with_name_clash.rb")
-      assert !File.exist?(symlink), 'should not install symlink for Ruby 1.9 (it\'s not needed'
-    end
-  end
-
-  context 'name clash with multiple binary packages' do
-    setup do
-      FileUtils.cp_r('test/sample/name_clash_multiple/', tmpdir)
-      @target_dir = File.join(tmpdir, 'name_clash_multiple')
-      self.class.build_package(@target_dir)
-    end
-    should 'work' do
-      symlink = File.join(@target_dir, 'debian/ruby-name-clash/usr/lib/ruby/vendor_ruby/1.8/name_clash.rb')
-      assert File.exist?(symlink), 'symlink not installed at %s!' % symlink
-    end
-  end
-
   context 'installing gemspec' do
     should 'install gemspec for simplegem' do
       assert_installed SIMPLE_GEM_DIRNAME, 'ruby-simplegem', '/usr/share/rubygems-integration/1.9.1/specifications/simplegem-0.0.1.gemspec'
diff --git a/test/unit/installer_test.rb b/test/unit/installer_test.rb
index 243d6a3..48466f9 100644
--- a/test/unit/installer_test.rb
+++ b/test/unit/installer_test.rb
@@ -107,9 +107,10 @@ class InstallerTest < Gem2DebTestCase
       @installer.expects(:rewrite_shebangs).with('/usr/bin/env ruby')
       @installer.send(:update_shebangs)
     end
-    should 'rewrite shebang to usr /usr/bin/ruby1.8 if only 1.8 is supported' do
-      @installer.stubs(:ruby_versions).returns(['ruby1.8'])
-      @installer.expects(:rewrite_shebangs).with('/usr/bin/ruby1.8')
+    should 'rewrite shebang to usr /usr/bin/ruby1.9.1 if only 1.9.1 is supported' do
+      @installer.stubs(:ruby_versions).returns(['ruby1.9.1'])
+      @installer.stubs(:supported_ruby_versions).returns(['ruby1.9.1', 'rubyX.Y'])
+      @installer.expects(:rewrite_shebangs).with('/usr/bin/ruby1.9.1')
       @installer.send(:update_shebangs)
     end
   end
@@ -169,7 +170,8 @@ class InstallerTest < Gem2DebTestCase
       assert_equal true, @installer.send(:all_ruby_versions_supported?)
     end
     should 'know when not all versions are supported' do
-      @installer.stubs(:ruby_versions).returns(['ruby1.8'])
+      @installer.stubs(:ruby_versions).returns(['ruby1.9.1'])
+      @installer.stubs(:supported_ruby_versions).returns(['ruby1.9.1', 'rubyX.Y'])
       assert_equal false, @installer.send(:all_ruby_versions_supported?)
     end
   end
diff --git a/test/unit/setup_rb_installer_test.rb b/test/unit/setup_rb_installer_test.rb
index 12734bc..17e5fdb 100644
--- a/test/unit/setup_rb_installer_test.rb
+++ b/test/unit/setup_rb_installer_test.rb
@@ -16,7 +16,6 @@ class SetupRbInstallerTest < Gem2DebTestCase
 
   context 'installing native extension with setuprb' do
     [
-     '1.8',
      '1.9.1',
     ].each do |version_number|
       vendorarchdir = VENDOR_ARCH_DIRS['ruby' + version_number]

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/gem2deb.git



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