Merge lp:~townsend/libertine/use-snap-user-common into lp:libertine

Proposed by Christopher Townsend
Status: Merged
Approved by: Larry Price
Approved revision: 343
Merged at revision: 344
Proposed branch: lp:~townsend/libertine/use-snap-user-common
Merge into: lp:libertine
Diff against target: 44 lines (+14/-4)
2 files modified
python/libertine/ChrootContainer.py (+1/-1)
python/libertine/utils.py (+13/-3)
To merge this branch: bzr merge lp:~townsend/libertine/use-snap-user-common
Reviewer Review Type Date Requested Status
Larry Price Approve
Libertine CI Bot continuous-integration Approve
Review via email: mp+312374@code.launchpad.net

Commit message

Redirect where the container is created when in a snap environment.

To post a comment you must log in.
Revision history for this message
Libertine CI Bot (libertine-ci-bot) wrote :

PASSED: Continuous integration, rev:343
https://jenkins.canonical.com/libertine/job/lp-libertine-ci/245/
Executed test runs:
    SUCCESS: https://jenkins.canonical.com/libertine/job/build/512
    SUCCESS: https://jenkins.canonical.com/libertine/job/test-0-autopkgtest/label=amd64,release=vivid+overlay,testname=default/405
    SUCCESS: https://jenkins.canonical.com/libertine/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=default/405
    SUCCESS: https://jenkins.canonical.com/libertine/job/test-0-autopkgtest/label=amd64,release=zesty,testname=default/405
    SUCCESS: https://jenkins.canonical.com/libertine/job/test-0-autopkgtest/label=i386,release=vivid+overlay,testname=default/405
    SUCCESS: https://jenkins.canonical.com/libertine/job/test-0-autopkgtest/label=i386,release=xenial+overlay,testname=default/405
    SUCCESS: https://jenkins.canonical.com/libertine/job/test-0-autopkgtest/label=i386,release=zesty,testname=default/405
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-0-fetch/522
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=amd64,release=vivid+overlay/506
        deb: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=amd64,release=vivid+overlay/506/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=amd64,release=xenial+overlay/506
        deb: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=amd64,release=xenial+overlay/506/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=amd64,release=zesty/506
        deb: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=amd64,release=zesty/506/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=i386,release=vivid+overlay/506
        deb: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=i386,release=vivid+overlay/506/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=i386,release=xenial+overlay/506
        deb: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=i386,release=xenial+overlay/506/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=i386,release=zesty/506
        deb: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=i386,release=zesty/506/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://jenkins.canonical.com/libertine/job/lp-libertine-ci/245/rebuild

review: Approve (continuous-integration)
Revision history for this message
Larry Price (larryprice) wrote :

lgtm

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'python/libertine/ChrootContainer.py'
--- python/libertine/ChrootContainer.py 2016-12-01 17:43:12 +0000
+++ python/libertine/ChrootContainer.py 2016-12-02 16:40:16 +0000
@@ -167,7 +167,7 @@
167 def _build_fakechroot_command(self):167 def _build_fakechroot_command(self):
168 cmd = 'fakechroot'168 cmd = 'fakechroot'
169169
170 if 'SNAP' in os.environ:170 if utils.is_snap_environment():
171 cmd = "{} -b {}/usr/sbin".format(cmd, os.environ['SNAP'])171 cmd = "{} -b {}/usr/sbin".format(cmd, os.environ['SNAP'])
172172
173 return cmd173 return cmd
174174
=== modified file 'python/libertine/utils.py'
--- python/libertine/utils.py 2016-11-09 20:10:45 +0000
+++ python/libertine/utils.py 2016-12-02 16:40:16 +0000
@@ -57,10 +57,13 @@
5757
5858
59def get_libertine_containers_dir_path():59def get_libertine_containers_dir_path():
60 xdg_cache_home = os.getenv('XDG_CACHE_HOME',60 if is_snap_environment():
61 os.path.join(os.getenv('HOME'), '.cache'))61 libertine_cache_home = os.path.join(os.getenv('SNAP_USER_COMMON'), '.cache')
62 else:
63 libertine_cache_home = os.getenv('XDG_CACHE_HOME',
64 os.path.join(os.getenv('HOME'), '.cache'))
6265
63 return os.path.join(xdg_cache_home, 'libertine-container')66 return os.path.join(libertine_cache_home, 'libertine-container')
6467
6568
66def get_libertine_database_dir_path():69def get_libertine_database_dir_path():
@@ -191,3 +194,10 @@
191 return False194 return False
192195
193 return True196 return True
197
198
199def is_snap_environment():
200 if 'SNAP' in os.environ:
201 return True
202 else:
203 return False

Subscribers

People subscribed via source and target branches