aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Hochstein <tom.hochstein@nxp.com>2020-03-18 09:55:57 -0500
committerOtavio Salvador <otavio@ossystems.com.br>2020-03-27 10:13:39 -0300
commitdef2b2d00f57768674f2ffcbdcad006dda922a35 (patch)
tree908cc16f91a2e8ccc076390e5860b6fe35d480a9
parent5b13ece620ec89049a168f0b01ccc6d22793e59f (diff)
downloadmeta-freescale-def2b2d00f57768674f2ffcbdcad006dda922a35.tar.gz
meta-freescale-def2b2d00f57768674f2ffcbdcad006dda922a35.tar.bz2
meta-freescale-def2b2d00f57768674f2ffcbdcad006dda922a35.zip
fsl-eula-unpack.bbclass: Cleanup
- Remove current working directory handling and use the equivalent runfetchcmd workdir parameter - Simplify the SRC_URI for loop Signed-off-by: Tom Hochstein <tom.hochstein@nxp.com> (cherry picked from commit fee27818df40719c62bddde717737fb30cef3013)
-rw-r--r--classes/fsl-eula-unpack.bbclass29
1 files changed, 10 insertions, 19 deletions
diff --git a/classes/fsl-eula-unpack.bbclass b/classes/fsl-eula-unpack.bbclass
index 03f576e5..9b8f2af6 100644
--- a/classes/fsl-eula-unpack.bbclass
+++ b/classes/fsl-eula-unpack.bbclass
@@ -22,25 +22,16 @@ python fsl_bin_do_unpack() {
fetcher = bb.fetch2.Fetch(src_uri, localdata)
for url in fetcher.ud.values():
- save_cwd = os.getcwd()
- # Check for supported fetchers
- if url.type in ['http', 'https', 'ftp', 'file']:
- if url.parm.get('fsl-eula', False):
- # If download has failed, do nothing
- if not os.path.exists(url.localpath):
- bb.debug(1, "Exiting as '%s' cannot be found" % url.basename)
- return
-
- # Change to the working directory
- bb.note("Handling file '%s' as a Freescale's EULA binary." % url.basename)
- save_cwd = os.getcwd()
- os.chdir(rootdir)
-
- cmd = "sh %s --auto-accept --force" % (url.localpath)
- bb.fetch2.runfetchcmd(cmd, d, quiet=True)
-
- # Return to the previous directory
- os.chdir(save_cwd)
+ # Skip this fetcher if it's not under EULA or if the fetcher type is not supported
+ if not url.parm.get('fsl-eula', False) or url.type not in ['http', 'https', 'ftp', 'file']:
+ continue
+ # If download has failed, do nothing
+ if not os.path.exists(url.localpath):
+ bb.debug(1, "Exiting as '%s' cannot be found" % url.basename)
+ return
+ bb.note("Handling file '%s' as a Freescale EULA-licensed archive." % url.basename)
+ cmd = "sh %s --auto-accept --force" % (url.localpath)
+ bb.fetch2.runfetchcmd(cmd, d, quiet=True, workdir=rootdir)
}
python do_unpack() {