Avoid use of breezy-debian.

This commit is contained in:
Jelmer Vernooij 2021-02-10 01:54:29 +00:00
parent dc29ed8b1d
commit 3fe7cb2a7e
No known key found for this signature in database
GPG key ID: 579C160D4C9E23E8
6 changed files with 55 additions and 31 deletions

View file

@ -34,10 +34,6 @@ from debian.changelog import Changelog
from debmutate.changelog import get_maintainer, format_datetime
from breezy import osutils
from breezy.plugins.debian.util import (
changes_filename,
get_build_architecture,
)
from breezy.mutabletree import MutableTree
from silver_platter.debian import (
BuildFailedError,
@ -57,6 +53,22 @@ class MissingChangesFile(Exception):
self.filename = filename
def changes_filename(package, version, arch):
non_epoch_version = version.upstream_version
if version.debian_version is not None:
non_epoch_version += "-%s" % version.debian_version
return "%s_%s_%s.changes" % (package, non_epoch_version, arch)
def get_build_architecture():
try:
return subprocess.check_output(
['dpkg-architecture', '-qDEB_BUILD_ARCH']).strip().decode()
except subprocess.CalledProcessError as e:
raise Exception(
"Could not find the build architecture: %s" % e)
def add_dummy_changelog_entry(
tree: MutableTree, subpath: str, suffix: str, suite: str,
message: str, timestamp=None, maintainer=None):

View file

@ -66,7 +66,6 @@ from silver_platter.debian import (
DEFAULT_BUILDER,
)
from breezy.plugins.debian.util import get_build_architecture
from .build import attempt_build
from buildlog_consultant import Problem
from buildlog_consultant.common import (