[DRE-commits] [SCM] gem2deb.git branch, master, updated. 527f52fdcd03a424f016d2e6b00966a6297666c9
Lucas Nussbaum
lucas at lucas-nussbaum.net
Fri Apr 29 12:18:16 UTC 2011
The following commit has been merged in the master branch:
commit 527f52fdcd03a424f016d2e6b00966a6297666c9
Merge: 7276bb2614ce685641291e9dfaba8faa82af2b98 447b2ca5e9f3e1f15deedc0b713fdc5d49d84fe6
Author: Lucas Nussbaum <lucas at lucas-nussbaum.net>
Date: Fri Apr 29 14:17:34 2011 +0200
Merge branch 'master' of github.com:ln/gem2deb
diff --combined lib/gem2deb/dh_ruby.rb
index 60e656d,5d954eb..d199168
--- a/lib/gem2deb/dh_ruby.rb
+++ b/lib/gem2deb/dh_ruby.rb
@@@ -34,7 -34,6 +34,7 @@@
require 'gem2deb'
require 'gem2deb/metadata'
require 'find'
+require 'fileutils'
module Gem2Deb
@@@ -65,20 -64,24 +65,24 @@@
end
def clean
- puts "Entering dh_ruby --clean" if @verbose
+ puts " Entering dh_ruby --clean" if @verbose
run_make_clean_on_extensions
+ puts " Leaving dh_ruby --clean" if @verbose
end
def configure
- # puts "Entering dh_ruby --configure" if @verbose
+ # puts " Entering dh_ruby --configure" if @verbose
+ # puts " Leaving dh_ruby --configure" if @verbose
end
def build
- # puts "Entering dh_ruby --build" if @verbose
+ # puts " Entering dh_ruby --build" if @verbose
+ # puts " Leaving dh_ruby --build" if @verbose
end
def test
- # puts "Entering dh_ruby --test" if @verbose
+ # puts " Entering dh_ruby --test" if @verbose
+ # puts " Leaving dh_ruby --test" if @verbose
end
EXTENSION_BUILDER = File.expand_path(File.join(File.dirname(__FILE__),'extension_builder.rb'))
@@@ -86,7 -89,7 +90,7 @@@
LIBDIR = File.expand_path(File.join(File.dirname(__FILE__), '..'))
def install(argv)
- puts "Entering dh_ruby --install" if @verbose
+ puts " Entering dh_ruby --install" if @verbose
package = packages.first
@@@ -109,14 -112,6 +113,14 @@@
supported_versions.each do |rubyver|
puts "Building extension for #{rubyver} ..." if @verbose
run("#{SUPPORTED_RUBY_VERSIONS[rubyver]} -I#{LIBDIR} #{EXTENSION_BUILDER} #{package}")
+
+ # Remove duplicate files installed by rubygems in the arch dir
+ # This is a hack to workaround a problem in rubygems
+ vendor_dir = File.join(destdir_for(package), RUBY_CODE_DIR)
+ vendor_arch_dir = File.join(destdir_for(package), `#{SUPPORTED_RUBY_VERSIONS[rubyver]} -rrbconfig -e "puts RbConfig::CONFIG['vendorarchdir']"`.chomp)
+ if File::exists?(vendor_dir) and File::exists?(vendor_arch_dir)
+ remove_duplicate_files(vendor_dir, vendor_arch_dir)
+ end
# run tests for this version of ruby
if not run_tests(rubyver)
supported_versions.delete(rubyver)
@@@ -142,32 -137,11 +146,33 @@@
# issue warnings
check_rubygems
+ puts " Leaving dh_ruby --install" if @verbose
end
protected
+ def remove_duplicate_files(src, dst)
+ candidates = (Dir::entries(src) & Dir::entries(dst)) - ['.', '..']
+ candidates.each do |cand|
+ if File::file?(File.join(src, cand)) and File::file?(File.join(dst, cand)) and IO::read(File.join(src, cand)) == IO::read(File.join(dst, cand))
+ FileUtils::Verbose.rm(File.join(dst, cand))
+ elsif File::directory?(File.join(src, cand)) and File::directory?(File.join(dst, cand))
+ files_src = files_dst = nil
+ Dir::chdir(File.join(src, cand)) do
+ files_src = Dir::glob('**/*', File::FNM_DOTMATCH).sort
+ end
+ Dir::chdir(File.join(dst, cand)) do
+ files_dst = Dir::glob('**/*', File::FNM_DOTMATCH).sort
+ end
+ if files_src == files_dst
+ if files_src.all? { |f| File.ftype(File.join(src, f)) == File.ftype(File.join(dst, f)) and (not File.file?(File.join(src, f)) or IO::read(File.join(src, cand)) == IO::read(File.join(dst, cand))) }
+ FileUtils::Verbose.rm_rf(File.join(dst, cand))
+ end
+ end
+ end
+ end
+ end
+
def check_rubygems
if skip_checks?
return
--
gem2deb.git
More information about the Pkg-ruby-extras-commits
mailing list