From 1c1e7a2364710db388bb4623a063da947ee4e7b4 Mon Sep 17 00:00:00 2001 From: Cheng-Lung Sung Date: Mon, 7 Jan 2008 03:51:31 +0000 Subject: - default not to write to source_cache file - add --no-update-sources in Makefile.common (thanks to Alexander Logvinov) - files/patch-lib-rubygems-source_info_cache.rb fix when try_file() write 4 bytes into source_cache even DEFAULT_UPDATE_SOURCES is false - files/patch-lib-rubygems-installer.rb - do not write to .require_paths file - currently we don't need it - link bin/gem18 to bin/gem - bump PORTERVISION PR: ports/119051 Submitted by: clsung Approved by: maintainer (Jonathan Weiss) --- devel/ruby-gems/Makefile | 5 +++- devel/ruby-gems/Makefile.common | 2 +- .../files/patch-lib-rubygems-installer.rb | 11 +++++++ .../files/patch-lib-rubygems-source_info_cache.rb | 34 ++++++++++++++++++++++ devel/ruby-gems/pkg-plist | 2 +- 5 files changed, 51 insertions(+), 3 deletions(-) create mode 100644 devel/ruby-gems/files/patch-lib-rubygems-installer.rb create mode 100644 devel/ruby-gems/files/patch-lib-rubygems-source_info_cache.rb (limited to 'devel/ruby-gems') diff --git a/devel/ruby-gems/Makefile b/devel/ruby-gems/Makefile index 5282ca066ba5..6ba298f3bd02 100644 --- a/devel/ruby-gems/Makefile +++ b/devel/ruby-gems/Makefile @@ -7,7 +7,7 @@ PORTNAME= gems PORTVERSION= 1.0.1 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= devel ruby MASTER_SITES= ${MASTER_SITE_RUBYFORGE} MASTER_SITE_SUBDIR= ruby${PORTNAME} @@ -30,4 +30,7 @@ PLIST_SUB+= DISTNAME="${DISTNAME}" do-install: cd ${WRKSRC}; ${RUBY} ${RUBY_SETUP} +post-install: + @${LN} -sf ${PREFIX}/bin/gem${RUBY_VER:E} ${PREFIX}/bin/gem + .include diff --git a/devel/ruby-gems/Makefile.common b/devel/ruby-gems/Makefile.common index dd2ccb033caf..a6805e0897a9 100644 --- a/devel/ruby-gems/Makefile.common +++ b/devel/ruby-gems/Makefile.common @@ -49,5 +49,5 @@ GEMFILES= ${DISTNAME}${EXTRACT_SUFX} do-install: .for _D in ${GEMFILES} - ${SETENV} ${GEM_ENV} ${RUBYGEMBIN} install --no-ri --install-dir ${PREFIX}/lib/ruby/gems/${REV} ${DISTDIR}/${DIST_SUBDIR}/${_D} -- --build-args ${CONFIGURE_ARGS} + ${SETENV} ${GEM_ENV} ${RUBYGEMBIN} install --no-update-sources --no-ri --install-dir ${PREFIX}/lib/ruby/gems/${REV} ${DISTDIR}/${DIST_SUBDIR}/${_D} -- --build-args ${CONFIGURE_ARGS} .endfor diff --git a/devel/ruby-gems/files/patch-lib-rubygems-installer.rb b/devel/ruby-gems/files/patch-lib-rubygems-installer.rb new file mode 100644 index 000000000000..f627c9d8f2b6 --- /dev/null +++ b/devel/ruby-gems/files/patch-lib-rubygems-installer.rb @@ -0,0 +1,11 @@ +--- lib/rubygems/installer.rb.orig 2007-12-21 08:43:06.000000000 +0800 ++++ lib/rubygems/installer.rb 2007-12-27 09:04:59.000000000 +0800 +@@ -134,7 +134,7 @@ + build_extensions + write_spec + +- write_require_paths_file_if_needed ++ # write_require_paths_file_if_needed + + # HACK remove? Isn't this done in multiple places? + cached_gem = File.join @gem_home, "cache", @gem.split(/\//).pop diff --git a/devel/ruby-gems/files/patch-lib-rubygems-source_info_cache.rb b/devel/ruby-gems/files/patch-lib-rubygems-source_info_cache.rb new file mode 100644 index 000000000000..85f801e750c4 --- /dev/null +++ b/devel/ruby-gems/files/patch-lib-rubygems-source_info_cache.rb @@ -0,0 +1,34 @@ +--- lib/rubygems/source_info_cache.rb.orig 2007-12-11 09:16:59.000000000 +0800 ++++ lib/rubygems/source_info_cache.rb 2007-12-26 17:24:45.000000000 +0800 +@@ -70,6 +70,9 @@ + begin + # Marshal loads 30-40% faster from a String, and 2MB on 20061116 is small + data = File.open cache_file, 'rb' do |fp| fp.read end ++ if data.length <= 4 then ++ raise ArgumentError, "Data too small" ++ end + @cache_data = Marshal.load data + + @cache_data.each do |url, sice| +@@ -85,11 +88,11 @@ + end + end + @cache_data +- rescue => e ++ rescue => ex + if Gem.configuration.really_verbose then + say "Exception during cache_data handling: #{ex.class} - #{ex}" + say "Cache file was: #{cache_file}" +- say "\t#{e.backtrace.join "\n\t"}" ++ say "\t#{ex.backtrace.join "\n\t"}" + end + reset_cache_data + end +@@ -107,6 +110,7 @@ + + def reset_cache_data + @cache_data = {} ++ FileUtils.rm @cache_file + end + + # The name of the cache file to be read diff --git a/devel/ruby-gems/pkg-plist b/devel/ruby-gems/pkg-plist index 6aea1bd91b17..d2891e8faa69 100644 --- a/devel/ruby-gems/pkg-plist +++ b/devel/ruby-gems/pkg-plist @@ -1,3 +1,4 @@ +bin/gem bin/gem18 bin/update_rubygems18 lib/ruby/gems/%%RUBY_VER%%/cache/sources-0.0.2.gem @@ -1391,7 +1392,6 @@ lib/ruby/gems/%%RUBY_VER%%/doc/%%DISTNAME%%/ri/created.rid @dirrm %%RUBY_SITELIBDIR%%/rubygems/commands @dirrm %%RUBY_SITELIBDIR%%/rubygems @dirrm %%RUBY_SITELIBDIR%%/rbconfig -@dirrmtry lib/ruby/gems/%%RUBY_VER%%/source_cache @dirrmtry lib/ruby/gems/%%RUBY_VER%%/specifications @dirrm lib/ruby/gems/%%RUBY_VER%%/gems/sources-0.0.2/lib @dirrm lib/ruby/gems/%%RUBY_VER%%/gems/sources-0.0.2 -- cgit v1.2.3