diff --git a/ognibuild/build.py b/ognibuild/build.py index 405a5b4..b582b11 100644 --- a/ognibuild/build.py +++ b/ognibuild/build.py @@ -15,14 +15,10 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -from .apt import AptManager from .buildsystem import detect_buildsystems, NoBuildToolsFound def run_build(session): - apt = AptManager(session) - apt.install(['git']) - # Some things want to write to the user's home directory, # e.g. pip caches in ~/.cache session.create_home() diff --git a/ognibuild/clean.py b/ognibuild/clean.py index 80bfaa0..67cf27a 100644 --- a/ognibuild/clean.py +++ b/ognibuild/clean.py @@ -15,14 +15,10 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -from .apt import AptManager from .buildsystem import detect_buildsystems, NoBuildToolsFound def run_clean(session): - apt = AptManager(session) - apt.install(['git']) - # Some things want to write to the user's home directory, # e.g. pip caches in ~/.cache session.create_home() diff --git a/ognibuild/dist.py b/ognibuild/dist.py index 247f5c1..8499e0c 100644 --- a/ognibuild/dist.py +++ b/ognibuild/dist.py @@ -18,11 +18,10 @@ import errno import logging import os -import re import shutil import sys import tempfile -from typing import Optional, List, Tuple +from typing import Optional from debian.deb822 import Deb822 @@ -35,11 +34,8 @@ from buildlog_consultant.sbuild import ( NoSpaceOnDevice, ) -from . import DetailedFailure, shebang_binary -from .apt import AptManager, UnidentifiedError -from .fix_build import run_with_build_fixer +from . import DetailedFailure from .buildsystem import detect_buildsystems, NoBuildToolsFound -from .session import Session from .session.schroot import SchrootSession from .vcs import dupe_vcs_tree, export_vcs_tree @@ -48,32 +44,7 @@ class DistNoTarball(Exception): """Dist operation did not create a tarball.""" -# TODO(jelmer): move this to debian/ -def satisfy_build_deps(session: Session, tree): - source = Deb822(tree.get_file('debian/control')) - deps = [] - for name in ['Build-Depends', 'Build-Depends-Indep', 'Build-Depends-Arch']: - try: - deps.append(source[name].strip().strip(',')) - except KeyError: - pass - for name in ['Build-Conflicts', 'Build-Conflicts-Indep', - 'Build-Conflicts-Arch']: - try: - deps.append('Conflicts: ' + source[name]) - except KeyError: - pass - deps = [ - dep.strip().strip(',') - for dep in deps] - apt = AptManager(session) - apt.satisfy(deps) - - def run_dist(session): - apt = AptManager(session) - apt.install(['git']) - # Some things want to write to the user's home directory, # e.g. pip caches in ~/.cache session.create_home() @@ -137,6 +108,7 @@ def create_dist_schroot( subdir = 'package' with SchrootSession(chroot) as session: if packaging_tree is not None: + from .debian import satisfy_build_deps satisfy_build_deps(session, packaging_tree) build_dir = os.path.join(session.location, 'build') @@ -175,6 +147,7 @@ if __name__ == '__main__': import argparse import breezy.bzr # noqa: F401 import breezy.git # noqa: F401 + from breezy.export import export parser = argparse.ArgumentParser() parser.add_argument( diff --git a/ognibuild/install.py b/ognibuild/install.py index 27ec180..b2c3922 100644 --- a/ognibuild/install.py +++ b/ognibuild/install.py @@ -15,7 +15,6 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -from .apt import AptManager from .buildsystem import detect_buildsystems, NoBuildToolsFound diff --git a/ognibuild/test.py b/ognibuild/test.py index 10c90d7..eb60e40 100644 --- a/ognibuild/test.py +++ b/ognibuild/test.py @@ -15,14 +15,10 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -from .apt import AptManager from .buildsystem import detect_buildsystems, NoBuildToolsFound def run_test(session): - apt = AptManager(session) - apt.install(['git']) - # Some things want to write to the user's home directory, # e.g. pip caches in ~/.cache session.create_home()