Split out build system.
This commit is contained in:
parent
7919d42f05
commit
69ae73b960
3 changed files with 44 additions and 8 deletions
|
@ -24,10 +24,6 @@ import sys
|
|||
DEFAULT_PYTHON = 'python3'
|
||||
|
||||
|
||||
class NoBuildToolsFound(Exception):
|
||||
"""No supported build tools were found."""
|
||||
|
||||
|
||||
class DetailedFailure(Exception):
|
||||
|
||||
def __init__(self, retcode, argv, error):
|
||||
|
|
39
ognibuild/buildsystem.py
Normal file
39
ognibuild/buildsystem.py
Normal file
|
@ -0,0 +1,39 @@
|
|||
#!/usr/bin/python
|
||||
# Copyright (C) 2019-2020 Jelmer Vernooij <jelmer@jelmer.uk>
|
||||
# encoding: utf-8
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
|
||||
import logging
|
||||
|
||||
|
||||
class NoBuildToolsFound(Exception):
|
||||
"""No supported build tools were found."""
|
||||
|
||||
|
||||
class BuildSystem(object):
|
||||
"""A particular buildsystem."""
|
||||
|
||||
def __init__(self, session):
|
||||
self.session = session
|
||||
|
||||
def dist(self):
|
||||
raise NotImplementedError(self.dist)
|
||||
|
||||
|
||||
def detect_buildsystems(session):
|
||||
"""Detect build systems."""
|
||||
return []
|
|
@ -33,6 +33,7 @@ from breezy.workingtree import WorkingTree
|
|||
from breezy.plugins.debian.repack_tarball import get_filetype
|
||||
|
||||
from . import apt, DetailedFailure, shebang_binary
|
||||
from .buildsystem import detect_buildsystems
|
||||
from .session import run_with_tee, Session
|
||||
from .session.schroot import SchrootSession
|
||||
from .debian.fix_build import (
|
||||
|
@ -141,10 +142,6 @@ def run_with_build_fixer(session: Session, args: List[str]):
|
|||
fixed_errors.append(error)
|
||||
|
||||
|
||||
class NoBuildToolsFound(Exception):
|
||||
"""No supported build tools were found."""
|
||||
|
||||
|
||||
def run_dist(session):
|
||||
apt.install(session, ['git'])
|
||||
|
||||
|
@ -152,6 +149,10 @@ def run_dist(session):
|
|||
# e.g. pip caches in ~/.cache
|
||||
session.create_home()
|
||||
|
||||
for buildsystem in detect_buildsystems(session):
|
||||
buildsystem.dist()
|
||||
return
|
||||
|
||||
if os.path.exists('package.xml'):
|
||||
apt.install(session, ['php-pear', 'php-horde-core'])
|
||||
logging.info('Found package.xml, assuming pear package.')
|
||||
|
|
Loading…
Add table
Reference in a new issue