You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
988 B

  1. #!/usr/bin/env python3
  2. # -*- coding: utf-8 -*-
  3. # Copyright 2017 LasLabs Inc.
  4. from glob import glob
  5. from os.path import basename, join, splitext
  6. from doodbalib import CUSTOM_DIR, FILE_APT_BUILD, SRC_DIR
  7. from doodbalib.installer import INSTALLERS, install, logger
  8. # Build dependencies installed before any others
  9. install("apt", FILE_APT_BUILD)
  10. for name in INSTALLERS:
  11. req_files = []
  12. # Normal dependency installation
  13. req_files.append(join(CUSTOM_DIR, "dependencies", "%s.txt" % name))
  14. for req_file in req_files:
  15. install(name, req_file)
  16. # Sorted dependencies installation
  17. dep_files = sorted(glob(join(CUSTOM_DIR, "dependencies", "[0-9]*-*")))
  18. for dep_file in dep_files:
  19. root, ext = splitext(basename(dep_file))
  20. # Get the installer (xxx-installer[-description][.ext])
  21. installer = root.split("-", 2)[1]
  22. if installer not in INSTALLERS:
  23. logger.error("Unknown installer: %s", installer)
  24. raise Exception
  25. install(installer, dep_file)