mirror of
https://github.com/openembedded/meta-openembedded.git
synced 2026-06-11 16:59:59 +00:00
ruby.bbclass: Fix usage with python3
* otherwise every recipe inheriting ruby fails with:
WARNING: Exception during build_dependencies for GEM_HOME
WARNING: Error during finalise of /home/jenkins/oe/world/shr-core/meta-openembedded/meta-ruby/recipes-devtools/ruby/bundler_git.bb
ERROR: Failure expanding variable RUBY_GEM_VERSION, expression was ${@get_rubygemsversion("/home/jenkins/oe/world/shr-core/tmp-glibc/sysroots/x86_64-linux/usr/bin")} which triggered exception TypeError: can't use a string pattern on a bytes-like object
ERROR: Task 22219 (/home/jenkins/oe/world/shr-core/meta-openembedded/meta-ruby/recipes-devtools/ruby/bundler_git.bb, do_fetch) failed with exit code '1'
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
This commit is contained in:
@@ -18,7 +18,7 @@ def get_rubyversion(p):
|
|||||||
if not isfile(cmd):
|
if not isfile(cmd):
|
||||||
return found_version
|
return found_version
|
||||||
|
|
||||||
version = subprocess.Popen([cmd, "--version"], stdout=subprocess.PIPE).communicate()[0]
|
version = subprocess.Popen([cmd, "--version"], stdout=subprocess.PIPE).communicate()[0].decode("utf-8")
|
||||||
|
|
||||||
r = re.compile("ruby ([0-9]+\.[0-9]+\.[0-9]+)*")
|
r = re.compile("ruby ([0-9]+\.[0-9]+\.[0-9]+)*")
|
||||||
m = r.match(version)
|
m = r.match(version)
|
||||||
@@ -38,7 +38,7 @@ def get_rubygemslocation(p):
|
|||||||
if not isfile(cmd):
|
if not isfile(cmd):
|
||||||
return found_loc
|
return found_loc
|
||||||
|
|
||||||
loc = subprocess.Popen([cmd, "env"], stdout=subprocess.PIPE).communicate()[0]
|
loc = subprocess.Popen([cmd, "env"], stdout=subprocess.PIPE).communicate()[0].decode("utf-8")
|
||||||
|
|
||||||
r = re.compile(".*\- (/usr.*/ruby/gems/.*)")
|
r = re.compile(".*\- (/usr.*/ruby/gems/.*)")
|
||||||
for line in loc.split('\n'):
|
for line in loc.split('\n'):
|
||||||
@@ -60,7 +60,7 @@ def get_rubygemsversion(p):
|
|||||||
if not isfile(cmd):
|
if not isfile(cmd):
|
||||||
return found_version
|
return found_version
|
||||||
|
|
||||||
version = subprocess.Popen([cmd, "env", "gemdir"], stdout=subprocess.PIPE).communicate()[0]
|
version = subprocess.Popen([cmd, "env", "gemdir"], stdout=subprocess.PIPE).communicate()[0].decode("utf-8")
|
||||||
|
|
||||||
r = re.compile(".*([0-9]+\.[0-9]+\.[0-9]+)$")
|
r = re.compile(".*([0-9]+\.[0-9]+\.[0-9]+)$")
|
||||||
m = r.match(version)
|
m = r.match(version)
|
||||||
|
|||||||
Reference in New Issue
Block a user