Import some fixes from resolver branch.
This commit is contained in:
parent
a411b4dc38
commit
95f5bc2a4c
8 changed files with 93 additions and 21 deletions
|
@ -16,19 +16,22 @@
|
|||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
|
||||
from typing import List
|
||||
import logging
|
||||
import re
|
||||
from typing import List, Iterator, Optional, Set
|
||||
|
||||
import os
|
||||
from buildlog_consultant.apt import (
|
||||
find_apt_get_failure,
|
||||
)
|
||||
from debian.deb822 import Release
|
||||
|
||||
from . import DetailedFailure
|
||||
from .session import Session, run_with_tee
|
||||
|
||||
|
||||
class UnidentifiedError(Exception):
|
||||
|
||||
def __init__(self, retcode, argv, lines, secondary=None):
|
||||
self.retcode = retcode
|
||||
self.argv = argv
|
||||
|
@ -42,11 +45,11 @@ def run_apt(session: Session, args: List[str]) -> None:
|
|||
retcode, lines = run_with_tee(session, args, cwd="/", user="root")
|
||||
if retcode == 0:
|
||||
return
|
||||
offset, line, error = find_apt_get_failure(lines)
|
||||
match, error = find_apt_get_failure(lines)
|
||||
if error is not None:
|
||||
raise DetailedFailure(retcode, args, error)
|
||||
if line is not None:
|
||||
raise UnidentifiedError(retcode, args, lines, secondary=(offset, line))
|
||||
if match is not None:
|
||||
raise UnidentifiedError(retcode, args, lines, secondary=(match.lineno, match.line))
|
||||
while lines and lines[-1] == "":
|
||||
lines.pop(-1)
|
||||
raise UnidentifiedError(retcode, args, lines)
|
||||
|
|
|
@ -61,13 +61,11 @@ def changes_filename(package, version, arch):
|
|||
|
||||
def get_build_architecture():
|
||||
try:
|
||||
return (
|
||||
subprocess.check_output(["dpkg-architecture", "-qDEB_BUILD_ARCH"])
|
||||
.strip()
|
||||
.decode()
|
||||
)
|
||||
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)
|
||||
raise Exception(
|
||||
"Could not find the build architecture: %s" % e)
|
||||
|
||||
|
||||
def add_dummy_changelog_entry(
|
||||
|
|
|
@ -28,12 +28,13 @@ from debian.deb822 import Deb822
|
|||
from breezy.tree import Tree
|
||||
from breezy.workingtree import WorkingTree
|
||||
|
||||
from . import DetailedFailure
|
||||
from .buildsystem import detect_buildsystems, NoBuildToolsFound
|
||||
from buildlog_consultant.common import (
|
||||
NoSpaceOnDevice,
|
||||
)
|
||||
|
||||
|
||||
from . import DetailedFailure
|
||||
from .buildsystem import detect_buildsystems, NoBuildToolsFound
|
||||
from .session.schroot import SchrootSession
|
||||
from .vcs import dupe_vcs_tree, export_vcs_tree
|
||||
|
||||
|
@ -47,7 +48,7 @@ SUPPORTED_DIST_EXTENSIONS = [
|
|||
".tbz2",
|
||||
".tar",
|
||||
".zip",
|
||||
]
|
||||
]
|
||||
|
||||
|
||||
def is_dist_file(fn):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue