[oe-commits] Richard Purdie : package: Don't export PATH

git at git.openembedded.org git at git.openembedded.org
Wed Feb 6 09:38:32 UTC 2013


Module: openembedded-core.git
Branch: master-next
Commit: 678ad9c1b0a09542240d3e48a21f0fb813b63007
URL:    http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=678ad9c1b0a09542240d3e48a21f0fb813b63007

Author: Richard Purdie <richard.purdie at linuxfoundation.org>
Date:   Fri Feb  1 14:28:34 2013 +0000

package: Don't export PATH

PATH is already exported, we don't need to do this each time we run
something, its just noise and overhead.

Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>

---

 meta/classes/package.bbclass |   14 +++++---------
 1 files changed, 5 insertions(+), 9 deletions(-)

diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
index 1858836..d93783f 100644
--- a/meta/classes/package.bbclass
+++ b/meta/classes/package.bbclass
@@ -233,7 +233,6 @@ def splitdebuginfo(file, debugfile, debugsrcdir, d):
     import commands, stat, subprocess
 
     dvar = d.getVar('PKGD', True)
-    pathprefix = "export PATH=%s; " % d.getVar('PATH', True)
     objcopy = d.getVar("OBJCOPY", True)
     debugedit = d.expand("${STAGING_LIBDIR_NATIVE}/rpm/bin/debugedit")
     workdir = d.getVar("WORKDIR", True)
@@ -252,14 +251,14 @@ def splitdebuginfo(file, debugfile, debugsrcdir, d):
 
     # We need to extract the debug src information here...
     if debugsrcdir:
-        subprocess.call("%s'%s' -b '%s' -d '%s' -i -l '%s' '%s'" % (pathprefix, debugedit, workparentdir, debugsrcdir, sourcefile, file), shell=True)
+        subprocess.call("'%s' -b '%s' -d '%s' -i -l '%s' '%s'" % (debugedit, workparentdir, debugsrcdir, sourcefile, file), shell=True)
 
     bb.mkdirhier(os.path.dirname(debugfile))
 
-    subprocess.call("%s'%s' --only-keep-debug '%s' '%s'" % (pathprefix, objcopy, file, debugfile), shell=True)
+    subprocess.call("'%s' --only-keep-debug '%s' '%s'" % (objcopy, file, debugfile), shell=True)
 
     # Set the debuglink to have the view of the file path on the target
-    subprocess.call("%s'%s' --add-gnu-debuglink='%s' '%s'" % (pathprefix, objcopy, debugfile, file), shell=True)
+    subprocess.call("'%s' --add-gnu-debuglink='%s' '%s'" % (objcopy, debugfile, file), shell=True)
 
     if newmode:
         os.chmod(file, origmode)
@@ -275,7 +274,6 @@ def copydebugsources(debugsrcdir, d):
     sourcefile = d.expand("${WORKDIR}/debugsources.list")
     if debugsrcdir and os.path.isfile(sourcefile):
         dvar = d.getVar('PKGD', True)
-        pathprefix = "export PATH=%s; " % d.getVar('PATH', True)
         strip = d.getVar("STRIP", True)
         objcopy = d.getVar("OBJCOPY", True)
         debugedit = d.expand("${STAGING_LIBDIR_NATIVE}/rpm/bin/debugedit")
@@ -322,7 +320,6 @@ def runstrip(file, elftype, d):
 
     import commands, stat, subprocess
 
-    pathprefix = "export PATH=%s; " % d.getVar('PATH', True)
     strip = d.getVar("STRIP", True)
 
     newmode = None
@@ -345,7 +342,7 @@ def runstrip(file, elftype, d):
     stripcmd = "'%s' %s '%s'" % (strip, extraflags, file)
     bb.debug(1, "runstrip: %s" % stripcmd)
 
-    ret = subprocess.call("%s%s" % (pathprefix, stripcmd), shell=True)
+    ret = subprocess.call(stripcmd, shell=True)
 
     if newmode:
         os.chmod(file, origmode)
@@ -747,8 +744,7 @@ python split_and_strip_files () {
     # 16 - kernel module
     def isELF(path):
         type = 0
-        pathprefix = "export PATH=%s; " % d.getVar('PATH', True)
-        ret, result = commands.getstatusoutput("%sfile '%s'" % (pathprefix, path))
+        ret, result = commands.getstatusoutput("file '%s'" % path)
 
         if ret:
             bb.error("split_and_strip_files: 'file %s' failed" % path)





More information about the Openembedded-commits mailing list