diff options
author | Jonathan Maw <jonathan.maw@codethink.co.uk> | 2017-01-25 12:53:01 +0000 |
---|---|---|
committer | Javier Jardón <jjardon@gnome.org> | 2017-05-11 08:24:19 +0000 |
commit | 74b01ff32958a58648450487ec1aab3dc340ddd5 (patch) | |
tree | 82855fc9f59a9bb23839dffc127713bb61ce22f1 | |
parent | a28840c8c60d1dedadaf41ee7882749435e76cc9 (diff) | |
download | ybd-74b01ff32958a58648450487ec1aab3dc340ddd5.tar.gz |
Make sandbox.install optionally take a destdir
-rw-r--r-- | ybd/sandbox.py | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/ybd/sandbox.py b/ybd/sandbox.py index b1a7bb4..0da4e48 100644 --- a/ybd/sandbox.py +++ b/ybd/sandbox.py @@ -72,9 +72,15 @@ def setup(dn): app.remove_dir(dn['sandbox']) -def install(dn, component): - # populate dn['sandbox'] with the artifact files from component - if os.path.exists(os.path.join(dn['sandbox'], 'baserock', +def install(dn, component, subdir=None): + + if subdir is None: + destdir = dn['sandbox'] + else: + destdir = os.path.join(dn['sandbox'], subdir) + os.mkdir(destdir) + # populate destdir with the artifact files from component + if os.path.exists(os.path.join(destdir, 'baserock', component['name'] + '.meta')): return app.log(dn, 'Sandbox: installing %s' % component['cache'], verbose=True) @@ -82,9 +88,9 @@ def install(dn, component): app.log(dn, 'Unable to get cache for', component['name'], exit=True) unpackdir = cache.get_cache(component) + '.unpacked' if dn.get('kind') is 'system': - copy_fs(unpackdir, dn['sandbox']) + copy_fs(unpackdir, destdir) else: - utils.hardlink_all_files(unpackdir, dn['sandbox']) + utils.hardlink_all_files(unpackdir, destdir) def ldconfig(dn): |