summaryrefslogtreecommitdiff
path: root/eclass
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
commitb22d411130d447c94ae2e07287c8d264ca5e4a3d (patch)
tree4769d71df63b9400b5953e4d1bc13ad2899fc3a4 /eclass
parentFix building with USE="flac -vorbis" wrt #325935 by Thomas Kahle. (diff)
downloadhistorical-b22d411130d447c94ae2e07287c8d264ca5e4a3d.tar.gz
historical-b22d411130d447c94ae2e07287c8d264ca5e4a3d.tar.bz2
historical-b22d411130d447c94ae2e07287c8d264ca5e4a3d.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')
-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