diff options
author | Tom Hochstein <tom.hochstein@nxp.com> | 2020-03-18 09:55:57 -0500 |
---|---|---|
committer | Otavio Salvador <otavio@ossystems.com.br> | 2020-03-27 10:14:14 -0300 |
commit | 237a47a907d7aac7e44f678b8bbda9f9c8923ce6 (patch) | |
tree | bca0bc67f56ccf460c5be7ac8b6b88b87af0e0f3 | |
parent | 4e5c7e0d4959b027698e15565df7d3286e6860fa (diff) | |
download | meta-freescale-237a47a907d7aac7e44f678b8bbda9f9c8923ce6.tar.gz |
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>
-rw-r--r-- | classes/fsl-eula-unpack.bbclass | 29 |
1 files changed, 10 insertions, 19 deletions
diff --git a/classes/fsl-eula-unpack.bbclass b/classes/fsl-eula-unpack.bbclass index 85099542..ee571f52 100644 --- a/classes/fsl-eula-unpack.bbclass +++ b/classes/fsl-eula-unpack.bbclass | |||
@@ -27,25 +27,16 @@ python fsl_bin_do_unpack() { | |||
27 | fetcher = bb.fetch2.Fetch(src_uri, localdata) | 27 | fetcher = bb.fetch2.Fetch(src_uri, localdata) |
28 | 28 | ||
29 | for url in fetcher.ud.values(): | 29 | for url in fetcher.ud.values(): |
30 | save_cwd = os.getcwd() | 30 | # Skip this fetcher if it's not under EULA or if the fetcher type is not supported |
31 | # Check for supported fetchers | 31 | if not url.parm.get('fsl-eula', False) or url.type not in ['http', 'https', 'ftp', 'file']: |
32 | if url.type in ['http', 'https', 'ftp', 'file']: | 32 | continue |
33 | if url.parm.get('fsl-eula', False): | 33 | # If download has failed, do nothing |
34 | # If download has failed, do nothing | 34 | if not os.path.exists(url.localpath): |
35 | if not os.path.exists(url.localpath): | 35 | bb.debug(1, "Exiting as '%s' cannot be found" % url.basename) |
36 | bb.debug(1, "Exiting as '%s' cannot be found" % url.basename) | 36 | return |
37 | return | 37 | bb.note("Handling file '%s' as a Freescale EULA-licensed archive." % url.basename) |
38 | 38 | cmd = "sh %s --auto-accept --force" % (url.localpath) | |
39 | # Change to the working directory | 39 | bb.fetch2.runfetchcmd(cmd, d, quiet=True, workdir=rootdir) |
40 | bb.note("Handling file '%s' as a Freescale's EULA binary." % url.basename) | ||
41 | save_cwd = os.getcwd() | ||
42 | os.chdir(rootdir) | ||
43 | |||
44 | cmd = "sh %s --auto-accept --force" % (url.localpath) | ||
45 | bb.fetch2.runfetchcmd(cmd, d, quiet=True) | ||
46 | |||
47 | # Return to the previous directory | ||
48 | os.chdir(save_cwd) | ||
49 | } | 40 | } |
50 | 41 | ||
51 | python do_unpack() { | 42 | python do_unpack() { |