Coverage for snapcraft/common : 78%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*- # # Copyright (C) 2015 Canonical Ltd # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License version 3 as # published by the Free Software Foundation. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>.
# Data/methods shared between plugins and snapcraft
assert isinstance(cmd, list), 'run command must be a list' # FIXME: This is gross to keep writing this, even when env is the same with tempfile.NamedTemporaryFile(mode='w+') as f: f.write(assemble_env()) f.write('\n') f.write('exec $*') f.flush() subprocess.check_call(['/bin/sh', f.name] + cmd, **kwargs)
# FIXME: This is gross to keep writing this, even when env is the same **kwargs).decode('utf8').strip()
sys.exit(1)
global _arch if _arch is None: _arch = subprocess.check_output( ['dpkg-architecture', '-qDEB_BUILD_ARCH']).decode('utf8').strip() return _arch
global _arch_triplet ['dpkg-architecture', '-qDEB_BUILD_MULTIARCH'] ).decode('utf8').strip()
global _plugindir
global _schemadir
|