# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/.
# vim: set expandtab tabstop=4 shiftwidth=4:
import os import shutil import subprocess from urllib.request import urlretrieve
from mozbuild.repackaging.application_ini import get_application_ini_values from mozbuild.repackaging.snapcraft_transform import (
SnapcraftTransform,
SnapDesktopFile,
)
# Obtain the build's version info
version, buildno = get_application_ini_values(
pkgsrc,
dict(section="App", value="Version"),
dict(section="App", value="BuildID"),
)
for dep in DEPS:
dep_target = os.path.join(snapdir, dep)
os.makedirs(os.path.dirname(dep_target), exist_ok=True) ifnot os.path.isfile(dep_target):
urlretrieve(os.path.join(upstream_repo, dep), dep_target)
# At last, build the snap.
env = os.environ.copy()
# Note that if snapcraft is run under snap then it will overwrite # this env var, but we still need to know `arch` to predict the # output file name below, and the env var might also be needed if # running a non-snap install of snapcraft.
env["SNAP_ARCH"] = arch
subprocess.check_call(
[snapcraft, "clean", "--use-lxd"],
env=env,
cwd=snapdir,
)
subprocess.check_call(
[snapcraft, "--use-lxd"],
env=env,
cwd=snapdir,
)
# Create a symlink to the file for later use.
latest_snap = os.path.join(snapdir, "latest.snap") try:
os.unlink(latest_snap) except FileNotFoundError: pass
os.symlink(snapfile, latest_snap)
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.