Skip to contentSkip to conversation

base.bbclass: Pass in PATH to popen.

PATCH In review Khem Raj 2 participants 2 messages Aug 29, 2009 – Aug 30, 2009

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/1 base.bbclass: Pass in PATH to popen.

On Mac OSX its not able to find md5sum if
path is not passed to os.popen shell.

---
 classes/base.bbclass |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
classes/base.bbclass +1 -1
index 97ccf5d..d29ba4b 100644
@@ -84,7 +84,7 @@ def base_chk_file(parser, pn, pv, src_uri, localpath, data):
 
     # call md5(sum) and shasum
     try:
-        md5pipe = os.popen('md5sum ' + localpath)
+	md5pipe = os.popen('PATH=%s md5sum %s' % (bb.data.getVar('PATH', data, True), localpath))
         md5data = (md5pipe.readline().split() or [ "" ])[0]
         md5pipe.close()
     except OSError:
Signature · 1 line
1.6.3.3
Acked-by on v1 1/1
#1 lore raw
Quoted 4 lines · Khem Raj

On Mac OSX its not able to find md5sum if
path is not passed to os.popen shell.

This fixes a host of other bugs as well

Quoted 17 lines
---
  classes/base.bbclass |    2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)
classes/base.bbclass +1 -1
index 97ccf5d..d29ba4b 100644
@@ -84,7 +84,7 @@ def base_chk_file(parser, pn, pv, src_uri, localpath, data):
 
      # call md5(sum) and shasum
      try:
-        md5pipe = os.popen('md5sum ' + localpath)
+	md5pipe = os.popen('PATH=%s md5sum %s' % (bb.data.getVar('PATH', data, True), localpath))
          md5data = (md5pipe.readline().split() or [ "" ])[0]
          md5pipe.close()
      except OSError: