ruby.bbclass: Fix usage with python3
PATCH 1/1 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 <[email protected]>
--- meta-ruby/classes/ruby.bbclass | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
meta-ruby/classes/ruby.bbclass +3 -3
@@ -18,7 +18,7 @@ def get_rubyversion(p): if not isfile(cmd): 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]+)*") m = r.match(version)
@@ -38,7 +38,7 @@ def get_rubygemslocation(p): if not isfile(cmd): 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/.*)") for line in loc.split('\n'):
@@ -60,7 +60,7 @@ def get_rubygemsversion(p): if not isfile(cmd): 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]+)$") m = r.match(version)
Signature · 1 line
2.8.4