summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiego Elio Pettenò <flameeyes@gentoo.org>2010-07-21 10:42:38 +0000
committerDiego Elio Pettenò <flameeyes@gentoo.org>2010-07-21 10:42:38 +0000
commitdbfc74b510ebf58b69f8ad8fb32f5be6d66ab1d1 (patch)
tree358a52aac467f3445d005816771f043ff0060faa /eclass/ruby-fakegem.eclass
parentFix building with USE="flac -vorbis" wrt #325935 by Thomas Kahle. (diff)
downloadgentoo-2-dbfc74b510ebf58b69f8ad8fb32f5be6d66ab1d1.tar.gz
gentoo-2-dbfc74b510ebf58b69f8ad8fb32f5be6d66ab1d1.tar.bz2
gentoo-2-dbfc74b510ebf58b69f8ad8fb32f5be6d66ab1d1.zip
Allow multiple archives in SRC_URI, and unpack them properly.
Note: this requires that there is at most one .gem file, as it'll be failing if ${S} exists when going to unpack the gem.
Diffstat (limited to 'eclass/ruby-fakegem.eclass')
-rw-r--r--eclass/ruby-fakegem.eclass46
1 files changed, 24 insertions, 22 deletions
diff --git a/eclass/ruby-fakegem.eclass b/eclass/ruby-fakegem.eclass
index 6394b13c536b..fe9b3446c861 100644
--- a/eclass/ruby-fakegem.eclass
+++ b/eclass/ruby-fakegem.eclass
@@ -1,6 +1,6 @@
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v 1.18 2010/05/24 07:34:14 flameeyes Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v 1.19 2010/07/21 10:42:38 flameeyes Exp $
#
# @ECLASS: ruby-fakegem.eclass
# @MAINTAINER:
@@ -148,7 +148,7 @@ ruby_fakegem_genspec() {
# so better taking this into consideration.
local quoted_description=${DESCRIPTION//\"/\\\"}
cat - > "${T}"/${RUBY_FAKEGEM_NAME}-${_ruby_implementation} <<EOF
-# generated by ruby-fakegem.eclass $Revision: 1.18 $
+# generated by ruby-fakegem.eclass $Revision: 1.19 $
Gem::Specification.new do |s|
s.name = "${RUBY_FAKEGEM_NAME}"
s.version = "${RUBY_FAKEGEM_VERSION}"
@@ -202,7 +202,7 @@ ruby_fakegem_binwrapper() {
#!${rubycmd}
# This is a simplified version of the RubyGems wrapper
#
-# Generated by ruby-fakegem.eclass $Revision: 1.18 $
+# Generated by ruby-fakegem.eclass $Revision: 1.19 $
require 'rubygems'
@@ -232,25 +232,27 @@ all_ruby_unpack() {
# Special support for extracting .gem files; the file need to be
# extracted twice and the mtime from the archive _has_ to be
# ignored (it's always set to epoch 0).
- #
- # This only works if there is exactly one archive and that archive
- # is a .gem file!
- if [[ $(wc -w <<< ${A}) == 1 ]] &&
- [[ ${A} == *.gem ]]; then
- ebegin "Unpacking .gem file..."
- tar -mxf ${DISTDIR}/${A} || die
- eend $?
-
- mkdir "${S}"
- pushd "${S}" &>/dev/null
-
- ebegin "Unpacking data.tar.gz"
- tar -mxf "${my_WORKDIR}"/data.tar.gz || die
- eend $?
- popd &>/dev/null
- else
- [[ -n ${A} ]] && unpack ${A}
- fi
+ for archive in ${A}; do
+ if [[ ${archive} == *.gem ]]; then
+ # Make sure that we're not running unoack for more than
+ # one .gem file, since we won't support that at all.
+ [[ -d "${S}" ]] && die "Unable to unpack ${archive}, ${S} exists"
+
+ ebegin "Unpacking .gem file..."
+ tar -mxf ${DISTDIR}/${archive} || die
+ eend $?
+
+ mkdir "${S}"
+ pushd "${S}" &>/dev/null
+
+ ebegin "Unpacking data.tar.gz"
+ tar -mxf "${my_WORKDIR}"/data.tar.gz || die
+ eend $?
+ popd &>/dev/null
+ else
+ unpack ${archive}
+ fi
+ done
}
# @FUNCTION: all_ruby_compile