Commit f3c62b5f authored by sirex's avatar sirex

Coorect way to find gem executable, which can be named differently, depending on host system.

parent 7e2fc17f
import errno import errno
import glob
import hexagonit.recipe.download import hexagonit.recipe.download
import logging import logging
import os import os
...@@ -116,6 +117,8 @@ class Recipe(object): ...@@ -116,6 +117,8 @@ class Recipe(object):
s = { s = {
'OPTIONS': ' '.join([ 'OPTIONS': ' '.join([
'--prefix=%s' % self.options['location'], '--prefix=%s' % self.options['location'],
'--no-rdoc',
'--no-ri',
]), ]),
} }
self.run('ruby setup.rb all %(OPTIONS)s' % s, env) self.run('ruby setup.rb all %(OPTIONS)s' % s, env)
...@@ -137,15 +140,25 @@ class Recipe(object): ...@@ -137,15 +140,25 @@ class Recipe(object):
os.chmod(executable, 0755) os.chmod(executable, 0755)
return executable return executable
def get_gem_executable(self, bindir):
gem_executable = os.path.join(bindir, 'gem')
gem_executable = glob.glob(gem_executable + '*')
if gem_executable:
return gem_executable[0]
def install(self): def install(self):
parts = [self.options['location']] parts = [self.options['location']]
if not os.path.exists(self.options['location']): bindir = os.path.join(self.options['location'], 'bin')
gem_executable = self.get_gem_executable(bindir)
if not gem_executable:
self._install_rubygems() self._install_rubygems()
gem_executable = self.get_gem_executable(bindir)
bindir = os.path.join(self.options['location'], 'bin')
s = { s = {
'GEM': os.path.join(bindir, 'gem1.8'), 'GEM': gem_executable,
'OPTIONS': ' '.join([ 'OPTIONS': ' '.join([
'--no-rdoc', '--no-rdoc',
'--no-ri', '--no-ri',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment