Support packaging subpath in create_dist_schroot.
This commit is contained in:
parent
b9da3cb223
commit
41d7d44b57
3 changed files with 10 additions and 10 deletions
|
@ -31,6 +31,8 @@ class DetailedFailure(Exception):
|
|||
|
||||
|
||||
class UnidentifiedError(Exception):
|
||||
"""An unidentified error."""
|
||||
|
||||
def __init__(self, retcode, argv, lines, secondary=None):
|
||||
self.retcode = retcode
|
||||
self.argv = argv
|
||||
|
|
|
@ -15,14 +15,14 @@
|
|||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
import os
|
||||
from debian.deb822 import Deb822
|
||||
|
||||
from ..session import Session
|
||||
|
||||
|
||||
# TODO(jelmer): move this to debian/
|
||||
def satisfy_build_deps(session: Session, tree):
|
||||
source = Deb822(tree.get_file("debian/control"))
|
||||
def satisfy_build_deps(session: Session, tree, debian_path):
|
||||
source = Deb822(tree.get_file(os.path.join(debian_path, "control")))
|
||||
deps = []
|
||||
for name in ["Build-Depends", "Build-Depends-Indep", "Build-Depends-Arch"]:
|
||||
try:
|
||||
|
|
|
@ -141,7 +141,6 @@ def create_dist(
|
|||
session: Session,
|
||||
tree: Tree,
|
||||
target_dir: str,
|
||||
packaging_tree: Optional[Tree] = None,
|
||||
include_controldir: bool = True,
|
||||
subdir: Optional[str] = None,
|
||||
cleanup: bool = False
|
||||
|
@ -151,11 +150,6 @@ def create_dist(
|
|||
|
||||
if subdir is None:
|
||||
subdir = "package"
|
||||
if packaging_tree is not None:
|
||||
from .debian import satisfy_build_deps
|
||||
|
||||
satisfy_build_deps(session, packaging_tree)
|
||||
|
||||
try:
|
||||
export_directory, reldir = session.setup_from_vcs(
|
||||
tree, include_controldir=include_controldir, subdir=subdir)
|
||||
|
@ -189,14 +183,18 @@ def create_dist_schroot(
|
|||
target_dir: str,
|
||||
chroot: str,
|
||||
packaging_tree: Optional[Tree] = None,
|
||||
packaging_subpath: Optional[str] = None,
|
||||
include_controldir: bool = True,
|
||||
subdir: Optional[str] = None,
|
||||
cleanup: bool = False
|
||||
) -> Optional[str]:
|
||||
with SchrootSession(chroot) as session:
|
||||
if packaging_tree is not None:
|
||||
from .debian import satisfy_build_deps
|
||||
|
||||
satisfy_build_deps(session, packaging_tree, packaging_subpath)
|
||||
return create_dist(
|
||||
session, tree, target_dir,
|
||||
packaging_tree=packaging_tree,
|
||||
include_controldir=include_controldir,
|
||||
subdir=subdir,
|
||||
cleanup=cleanup)
|
||||
|
|
Loading…
Add table
Reference in a new issue