[oe-commits] [bitbake] branch master updated: s3.py: Remove hardcoded aws

git at git.openembedded.org git at git.openembedded.org
Thu Mar 30 09:43:13 UTC 2017


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master
in repository bitbake.

The following commit(s) were added to refs/heads/master by this push:
     new fdeaed7  s3.py: Remove hardcoded aws
fdeaed7 is described below

commit fdeaed70a7d1ff8be1a1de937cb864130b0c2c86
Author: Elizabeth 'pidge' Flanagan <pidge at toganlabs.com>
AuthorDate: Thu Mar 30 11:06:13 2017 +0200

    s3.py: Remove hardcoded aws
    
    This commit looks to see if FETCHCMD_s3 is set and if not, sets
    it.
    
    This is needed because I've use cases where I don't use aws, but
    s3cmd (due to license).
    
    Signed-off-by: Elizabeth 'pidge' Flanagan <pidge at toganlabs.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 lib/bb/fetch2/s3.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/lib/bb/fetch2/s3.py b/lib/bb/fetch2/s3.py
index 27993aa..1629288 100644
--- a/lib/bb/fetch2/s3.py
+++ b/lib/bb/fetch2/s3.py
@@ -55,13 +55,15 @@ class S3(FetchMethod):
 
         ud.localfile = d.expand(urllib.parse.unquote(ud.basename))
 
+        ud.basecmd = d.getVar("FETCHCMD_s3") or "/usr/bin/env aws s3"
+
     def download(self, ud, d):
         """
         Fetch urls
         Assumes localpath was called first
         """
 
-        cmd = 'aws s3 cp s3://%s%s %s' % (ud.host, ud.path, ud.localpath)
+        cmd = '%s cp s3://%s%s %s' % (ud.basecmd, ud.host, ud.path, ud.localpath)
         bb.fetch2.check_network_access(d, cmd, ud.url)
         runfetchcmd(cmd, d)
 
@@ -83,7 +85,7 @@ class S3(FetchMethod):
         Check the status of a URL
         """
 
-        cmd = 'aws s3 ls s3://%s%s' % (ud.host, ud.path)
+        cmd = '%s ls s3://%s%s' % (ud.basecmd, ud.host, ud.path)
         bb.fetch2.check_network_access(d, cmd, ud.url)
         output = runfetchcmd(cmd, d)
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list