From e12482ed93f5289f574fc3fc678bb0d01fc97244c7d9607ecf6d5f65874d7854 Mon Sep 17 00:00:00 2001 From: Stephan Kulow Date: Fri, 27 Jul 2012 14:03:20 +0000 Subject: [PATCH] - replace /usr/local/bin/ruby with /usr/bin/ruby - a very often mistake OBS-URL: https://build.opensuse.org/package/show/devel:languages:ruby/ruby-common?expand=0&rev=11 --- gem_install.sh | 12 +++++++++++- ruby-common.changes | 5 +++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/gem_install.sh b/gem_install.sh index e42a781..52e1dbf 100644 --- a/gem_install.sh +++ b/gem_install.sh @@ -13,13 +13,14 @@ gem_binary=gem defaultgem= gemfile= otheropts= +buildroot= while [ $# -gt 0 ] do case $1 in --default-gem) defaultgem=$2 ; shift;; --gem-binary) gem_binary="$2" ; shift;; - --build-root) otheropts="$otheropts $1=$2"; shift;; + --build-root) otheropts="$otheropts $1=$2"; buildroot=$2; shift;; (--) ;; (-*) otheropts="$otheropts $1";; (*) gemfile=$1; otheropts="$otheropts $1"; break;; @@ -29,6 +30,10 @@ done if [ "x$gemfile" = "x" ] ; then gemfile=$(find . -maxdepth 2 -type f -name "$defaultgem") + # if still empty, we pick the sources + if [ "x$gemfile" = "x" ] ; then + gemfile=$(find $RPM_SOURCE_DIR -name "$defaultgem") + fi otheropts="$otheropts $gemfile" fi set -x @@ -43,3 +48,8 @@ if test -d $RPM_BUILD_ROOT/usr/bin; then fi fi +if [ -d "$buildroot" ]; then + find $buildroot -type f -perm /u+x | while read file; do + sed -i -e 's,#!/usr/local/bin/ruby,#!/usr/bin/ruby,' "$file" + done +fi diff --git a/ruby-common.changes b/ruby-common.changes index 7bb595e..b003245 100644 --- a/ruby-common.changes +++ b/ruby-common.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Fri Jul 27 14:03:05 UTC 2012 - coolo@suse.com + +- replace /usr/local/bin/ruby with /usr/bin/ruby - a very often mistake + ------------------------------------------------------------------- Thu Jul 26 11:13:13 UTC 2012 - coolo@suse.com