Exemple #1
0
 def __init__(self,):
     # Set up logger:
     self.log = pb_logging.logger.getChild("PackageManager")
     self.cfg = config_manager
     self.prefix_available = self.cfg.get_active_prefix().prefix_dir is not None
     # Create a source package manager
     if self.prefix_available:
         self.src = packagers.Source()
         self.prefix = self.cfg.get_active_prefix()
     else:
         self.log.debug("No prefix specified. Skipping source package manager.")
         self.src = None
     # Create sorted list of binary package managers
     requested_packagers = [x.strip() for x in self.cfg.get('packagers').split(',') if x]
     binary_pkgrs = []
     for pkgr in requested_packagers:
         self.log.debug("Attempting to add binary package manager {}".format(pkgr))
         p = packagers.get_by_name(pkgr, packagers.__dict__.values())
         if p is None:
             self.log.warn("This binary package manager can't be instantiated: {}".format(pkgr))
             continue
         if p.supported():
             self.log.debug("{} is supported!".format(pkgr))
             binary_pkgrs.append(p)
     self._packagers = []
     for satisfy in self.cfg.get('satisfy_order').split(','):
         satisfy = satisfy.strip()
         if satisfy == 'src':
             if self.prefix_available:
                 self._packagers += [self.src,]
         elif satisfy == 'native':
             self._packagers += binary_pkgrs
         else:
             raise PBException("Invalid satisfy_order value: {}".format(satisfy))
     self.log.debug("Using packagers: {}".format([x.name for x in self._packagers]))
 def __init__(self, ):
     # Set up logger:
     self.log = pb_logging.logger.getChild("PackageManager")
     self.cfg = config_manager
     self.pmc = PACKAGE_MANAGER_CACHE
     self.prefix_available = self.cfg.get_active_prefix(
     ).prefix_dir is not None
     # Create a source package manager
     if self.prefix_available:
         self.src = packagers.Source()
         self.prefix = self.cfg.get_active_prefix()
     else:
         self.log.debug(
             "No prefix specified. Skipping source package manager.")
         self.src = None
     # Create sorted list of binary package managers
     requested_packagers = [
         x.strip() for x in self.cfg.get('packagers').split(',') if x
     ]
     self.binary_pkgrs = []
     for pkgr in requested_packagers:
         self.log.debug(
             "Attempting to add binary package manager {0}".format(pkgr))
         p = packagers.get_by_name(pkgr, packagers.__dict__.values())
         if p is None:
             self.log.warn(
                 "This binary package manager can't be instantiated: {0}".
                 format(pkgr))
             continue
         if p.supported():
             self.log.debug("{0} is supported!".format(pkgr))
             self.binary_pkgrs.append(p)
     self.log.debug("Using binary packagers: {0}".format(
         str([x.name for x in self.binary_pkgrs])))
Exemple #3
0
 def __init__(self, ):
     # Set up logger:
     self.log = pb_logging.logger.getChild("PackageManager")
     self.cfg = config_manager
     self.pmc = PACKAGE_MANAGER_CACHE
     self.prefix_available = self.cfg.get_active_prefix(
     ).prefix_dir is not None
     # Create a source package manager
     if self.prefix_available:
         self.src = packagers.Source()
     else:
         self.log.debug(
             "No prefix specified. Skipping source package manager.")
         self.src = packagers.NoSource()
     # Create sorted list of binary package managers
     self.binary_pkgrs = packagers.filter_available_packagers(
         self.cfg.get('packagers'), packagers.__dict__.values(), self.log)