Move some more things around.
This commit is contained in:
parent
69ae73b960
commit
093343b085
1 changed files with 20 additions and 5 deletions
|
@ -26,6 +26,7 @@ from typing import Optional, List, Tuple, Callable, Type
|
||||||
|
|
||||||
from debian.deb822 import Deb822
|
from debian.deb822 import Deb822
|
||||||
|
|
||||||
|
from breezy.errors import NotBranchError
|
||||||
from breezy.export import export
|
from breezy.export import export
|
||||||
from breezy.tree import Tree
|
from breezy.tree import Tree
|
||||||
from breezy.workingtree import WorkingTree
|
from breezy.workingtree import WorkingTree
|
||||||
|
@ -33,7 +34,7 @@ from breezy.workingtree import WorkingTree
|
||||||
from breezy.plugins.debian.repack_tarball import get_filetype
|
from breezy.plugins.debian.repack_tarball import get_filetype
|
||||||
|
|
||||||
from . import apt, DetailedFailure, shebang_binary
|
from . import apt, DetailedFailure, shebang_binary
|
||||||
from .buildsystem import detect_buildsystems
|
from .buildsystem import detect_buildsystems, NoBuildToolsFound
|
||||||
from .session import run_with_tee, Session
|
from .session import run_with_tee, Session
|
||||||
from .session.schroot import SchrootSession
|
from .session.schroot import SchrootSession
|
||||||
from .debian.fix_build import (
|
from .debian.fix_build import (
|
||||||
|
@ -50,6 +51,10 @@ from buildlog_consultant.sbuild import (
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
class DistNoTarball(Exception):
|
||||||
|
"""Dist operation did not create a tarball."""
|
||||||
|
|
||||||
|
|
||||||
def satisfy_build_deps(session: Session, tree):
|
def satisfy_build_deps(session: Session, tree):
|
||||||
source = Deb822(tree.get_file('debian/control'))
|
source = Deb822(tree.get_file('debian/control'))
|
||||||
deps = []
|
deps = []
|
||||||
|
@ -353,9 +358,16 @@ def dupe_vcs_tree(tree, directory):
|
||||||
raise DetailedFailure(
|
raise DetailedFailure(
|
||||||
1, ['sprout'], NoSpaceOnDevice())
|
1, ['sprout'], NoSpaceOnDevice())
|
||||||
raise
|
raise
|
||||||
|
if not result.has_workingtree():
|
||||||
|
raise AssertionError
|
||||||
# Copy parent location - some scripts need this
|
# Copy parent location - some scripts need this
|
||||||
base_branch = tree._repository.controldir.open_branch()
|
if isinstance(tree, WorkingTree):
|
||||||
parent = base_branch.get_parent()
|
parent = tree.branch.get_parent()
|
||||||
|
else:
|
||||||
|
try:
|
||||||
|
parent = tree._repository.controldir.open_branch()
|
||||||
|
except NotBranchError:
|
||||||
|
parent = None
|
||||||
if parent:
|
if parent:
|
||||||
result.open_branch().set_parent(parent)
|
result.open_branch().set_parent(parent)
|
||||||
|
|
||||||
|
@ -429,12 +441,12 @@ def create_dist_schroot(
|
||||||
return fn
|
return fn
|
||||||
|
|
||||||
logging.info('No tarball created :(')
|
logging.info('No tarball created :(')
|
||||||
return None
|
raise DistNoTarball()
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
import argparse
|
import argparse
|
||||||
import breezy.bzr
|
import breezy.bzr # noqa: F401
|
||||||
import breezy.git # noqa: F401
|
import breezy.git # noqa: F401
|
||||||
|
|
||||||
parser = argparse.ArgumentParser()
|
parser = argparse.ArgumentParser()
|
||||||
|
@ -451,6 +463,9 @@ if __name__ == '__main__':
|
||||||
'--target-directory', type=str, default='..',
|
'--target-directory', type=str, default='..',
|
||||||
help='Target directory')
|
help='Target directory')
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
|
logging.basicConfig(level=logging.INFO)
|
||||||
|
|
||||||
tree = WorkingTree.open(args.directory)
|
tree = WorkingTree.open(args.directory)
|
||||||
if args.packaging_directory:
|
if args.packaging_directory:
|
||||||
packaging_tree = WorkingTree.open(args.packaging_directory)
|
packaging_tree = WorkingTree.open(args.packaging_directory)
|
||||||
|
|
Loading…
Add table
Reference in a new issue