summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorHans de Graaff <graaff@gentoo.org>2014-12-07 07:23:12 +0000
committerHans de Graaff <graaff@gentoo.org>2014-12-07 07:23:12 +0000
commit5519705209f67f3e93f2bbf211d45f8b72376c59 (patch)
tree664d8b55c900d3f443d283f9389f7c55142d741f /eclass
parentCleanup for security bug 529216. (diff)
downloadhistorical-5519705209f67f3e93f2bbf211d45f8b72376c59.tar.gz
historical-5519705209f67f3e93f2bbf211d45f8b72376c59.tar.bz2
historical-5519705209f67f3e93f2bbf211d45f8b72376c59.zip
Allow additional content to be injected in the ruby bin wrapper.
Diffstat (limited to 'eclass')
-rw-r--r--eclass/ChangeLog5
-rw-r--r--eclass/ruby-fakegem.eclass14
2 files changed, 13 insertions, 6 deletions
diff --git a/eclass/ChangeLog b/eclass/ChangeLog
index 514c36e8f729..dd7fe1eb9cd0 100644
--- a/eclass/ChangeLog
+++ b/eclass/ChangeLog
@@ -1,6 +1,9 @@
# ChangeLog for eclass directory
# Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1453 2014/12/04 10:32:10 mrueg Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1454 2014/12/07 07:23:12 graaff Exp $
+
+ 07 Dec 2014; Hans de Graaff <graaff@gentoo.org> ruby-fakegem.eclass:
+ Allow additional content to be injected in the ruby bin wrapper.
04 Dec 2014; Manuel Rüger <mrueg@gentoo.org> kde4-base.eclass:
Sync kde4-base.eclass with overlay.
diff --git a/eclass/ruby-fakegem.eclass b/eclass/ruby-fakegem.eclass
index 153c3fd7534a..3ed591e681fd 100644
--- a/eclass/ruby-fakegem.eclass
+++ b/eclass/ruby-fakegem.eclass
@@ -1,6 +1,6 @@
# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v 1.41 2014/04/21 07:35:43 graaff Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v 1.42 2014/12/07 07:23:12 graaff Exp $
# @ECLASS: ruby-fakegem.eclass
# @MAINTAINER:
@@ -287,7 +287,7 @@ ruby_fakegem_genspec() {
# so better taking this into consideration.
local quoted_description=${DESCRIPTION//\"/\\\"}
cat - > $1 <<EOF
-# generated by ruby-fakegem.eclass $Revision: 1.41 $
+# generated by ruby-fakegem.eclass $Revision: 1.42 $
Gem::Specification.new do |s|
s.name = "${RUBY_FAKEGEM_NAME}"
s.version = "${RUBY_FAKEGEM_VERSION}"
@@ -299,14 +299,17 @@ EOF
}
# @FUNCTION: ruby_fakegem_binwrapper
-# @USAGE: command [path]
+# @USAGE: command [path] [content]
# @DESCRIPTION:
# Creates a new binary wrapper for a command installed by the RubyGem.
-# path defaults to /usr/bin/$command
+# path defaults to /usr/bin/$command content is optional and can be used
+# to inject additional ruby code into the wrapper. This may be useful to
+# e.g. force a specific version using the gem command.
ruby_fakegem_binwrapper() {
(
local gembinary=$1
local newbinary=${2:-/usr/bin/$gembinary}
+ local content=$3
local relativegembinary=${RUBY_FAKEGEM_NAME}-${RUBY_FAKEGEM_VERSION}/bin/${gembinary}
local binpath=$(dirname $newbinary)
[[ ${binpath} = . ]] && binpath=/usr/bin
@@ -337,10 +340,11 @@ ruby_fakegem_binwrapper() {
#!${rubycmd}
# This is a simplified version of the RubyGems wrapper
#
-# Generated by ruby-fakegem.eclass $Revision: 1.41 $
+# Generated by ruby-fakegem.eclass $Revision: 1.42 $
require 'rubygems'
+${content}
load Gem::default_path[-1] + "/gems/${relativegembinary}"
EOF