summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiego Elio Pettenò <flameeyes@gentoo.org>2010-01-21 10:18:59 +0000
committerDiego Elio Pettenò <flameeyes@gentoo.org>2010-01-21 10:18:59 +0000
commit50b8b78b138ed66f32d70744f912b29db463322b (patch)
treefe041513d0ea332b56c5c58f399bddfb084f62ea /eclass/ruby-fakegem.eclass
parentKeyword ~amd64-linux/~x86-linux (diff)
downloadgentoo-2-50b8b78b138ed66f32d70744f912b29db463322b.tar.gz
gentoo-2-50b8b78b138ed66f32d70744f912b29db463322b.tar.bz2
gentoo-2-50b8b78b138ed66f32d70744f912b29db463322b.zip
Default to installing the binary wrapper to /usr/bin, when calling
with just a basename for the wrapped tool. Thanks to Klaus Birkelund Jensen for reporting, in bug #301621.
Diffstat (limited to 'eclass/ruby-fakegem.eclass')
-rw-r--r--eclass/ruby-fakegem.eclass6
1 files changed, 4 insertions, 2 deletions
diff --git a/eclass/ruby-fakegem.eclass b/eclass/ruby-fakegem.eclass
index 9a196f67a84b..ded5bc5d6d07 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.11 2010/01/18 22:01:46 flameeyes Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v 1.12 2010/01/21 10:18:59 flameeyes Exp $
#
# @ECLASS: ruby-fakegem.eclass
# @MAINTAINER:
@@ -170,6 +170,8 @@ ruby_fakegem_binwrapper() {
local gembinary=$1
local newbinary=${2:-/usr/bin/$gembinary}
local relativegembinary=${RUBY_FAKEGEM_NAME}-${RUBY_FAKEGEM_VERSION}/bin/${gembinary}
+ local binpath=$(dirname $newbinary)
+ [[ ${binpath} = . ]] && binpath=/usr/bin
cat - > "${T}"/gembin-wrapper-${gembinary} <<EOF
#!/usr/bin/env ruby
@@ -183,7 +185,7 @@ load Gem::default_path[-1] + "/gems/${relativegembinary}"
EOF
- exeinto $(dirname $newbinary)
+ exeinto ${binpath:-/usr/bin}
newexe "${T}"/gembin-wrapper-${gembinary} $(basename $newbinary)
) || die "Unable to create fakegem wrapper"
}