def main(): distro = get_distro() print() packages = get_packages(distro) dependencies = get_dependencies(distro, packages) if dependencies: install_command = install_commands[distro] + list(dependencies) print() print('Installing packages...') print(' '.join(install_command)) run_command(install_command) else: print() print('No packages to install') print() print('Fetching submodules') for package in packages: if package.has_submodules: run_command(['git', 'submodule', 'update', '--init', '--recursive', package.path]) print() for package in packages: print('Setting up {}'.format(package)) package.setup(distro)
def package_detail(id=None): packages = get_packages() package = None if id is not None: for p in packages: if p["id"] == id: package = p break if package is None: return jsonify(error=404, message="Package not found"), 404 return jsonify(package)
"simplejson", "ujson", "python_socketio", "gevent_websocket", "flask", "pyxb == 1.2.3", "enum34", "dtls", "geventhttpclient" ] # packages PACKAGES = ["aplus", "openmtc", "openmtc_onem2m", "futile", "openmtc_app"] PACKAGE_DIR = { "": "common/openmtc/lib", "openmtc": "common/openmtc/src/openmtc", "openmtc_onem2m": "common/openmtc-onem2m/src/openmtc_onem2m", "openmtc_app": "openmtc-app/src/openmtc_app", "futile": "futile/src/futile" } all_packages = [] for package in PACKAGES: all_packages.extend(get_packages(package, PACKAGE_DIR)) # scripts SETUP_SCRIPTS = [] # package data PACKAGE_DATA = {NAME: []} # data files DATA_FILES = [] # cmd class CMD_CLASS = {'sdist': OpenMTCSdist} if __name__ == "__main__": ############################################################################
def test_get_packages(self): line = 'bin/busybox utils/busybox,shells/busybox-static' packages = utils.get_packages(line) self.assertEqual(packages, ['utils/busybox', 'shells/busybox-static'])
"openmtc_gevent", "openmtc_cse", "openmtc_server" ] PACKAGE_DIR = { "": "common/openmtc/lib", "openmtc": "common/openmtc/src/openmtc", "openmtc_onem2m": "common/openmtc-onem2m/src/openmtc_onem2m", "futile": "futile/src/futile", "openmtc_app": "openmtc-app/src/openmtc_app", "openmtc_gevent": "openmtc-gevent/src/openmtc_gevent", "openmtc_cse": "server/openmtc-cse/src/openmtc_cse", "openmtc_server": "server/openmtc-server/src/openmtc_server" } all_packages = [] EXCLUDE = [] for package in PACKAGES: all_packages.extend(get_packages(package, PACKAGE_DIR, EXCLUDE)) # scripts SETUP_SCRIPTS = glob("openmtc-gevent/bin/*") # package data PACKAGE_DATA = {} # data files DB_DIR = "/var/lib/openmtc" LOG_DIR = "/var/log/openmtc" LOG_ROTATE_DIR = "/etc/logrotate.d" LOG_ROTATE_FILES = ("openmtc-gevent/etc/logrotate.d/openmtc", ) INIT_DIR = "/etc/init.d" INIT_DIST_FILES = ("openmtc-gevent/etc/init.d/openmtc-gateway", "openmtc-gevent/etc/init.d/openmtc-backend")
def package_list(): packages = get_packages() return jsonify(packages)
import pytest import utils @pytest.mark.parametrize("name", utils.get_packages()) @pytest.mark.parametrize("host", utils.get_host()) def test_packages(host, name): pkg = host.package(name) assert pkg.is_installed