Exemplo n.º 1
0
 def delete_packages(self, manager, packages, force=False):
     """
         delete one or more packages using the package manager inside
         of the new root directory
     """
     log.info('Deleting system packages (chroot)')
     all_delete_items = self.__setup_requests(
         manager, packages
     )
     if all_delete_items:
         process = CommandProcess(
             command=manager.process_delete_requests(force),
             log_topic='system'
         )
         try:
             process.poll_show_progress(
                 items_to_complete=all_delete_items,
                 match_method=process.create_match_method(
                     manager.match_package_deleted
                 )
             )
         except Exception as e:
             raise KiwiSystemDeletePackagesFailed(
                 'Package deletion failed: %s' % format(e)
             )
Exemplo n.º 2
0
 def install_system(self, manager):
     """
         install system software using the package manager inside
         of the new root directory. This is done via a chroot operation
         and requires the desired package manager to became installed
         via the bootstrap phase
     """
     log.info(
         'Installing system (chroot) for build type: %s',
         self.xml_state.get_build_type_name()
     )
     collection_type = self.xml_state.get_system_collection_type()
     log.info('--> collection type: %s', collection_type)
     system_packages = self.xml_state.get_system_packages()
     system_collections = self.xml_state.get_system_collections()
     system_products = self.xml_state.get_system_products()
     system_archives = self.xml_state.get_system_archives()
     # process package installations
     if collection_type == 'onlyRequired':
         manager.process_only_required()
     all_install_items = self.__setup_requests(
         manager,
         system_packages,
         system_collections,
         system_products
     )
     if all_install_items:
         process = CommandProcess(
             command=manager.process_install_requests(), log_topic='system'
         )
         try:
             process.poll_show_progress(
                 items_to_complete=all_install_items,
                 match_method=process.create_match_method(
                     manager.match_package_installed
                 )
             )
         except Exception as e:
             raise KiwiInstallPhaseFailed(
                 'System package installation failed: %s' % format(e)
             )
     # process archive installations
     if system_archives:
         try:
             self.__install_archives(system_archives)
         except Exception as e:
             raise KiwiInstallPhaseFailed(
                 'System archive installation failed: %s' % format(e)
             )
Exemplo n.º 3
0
 def install_bootstrap(self, manager):
     """
         install system software using the package manager
         from the host, also known as bootstrapping
     """
     log.info('Installing bootstrap packages')
     bootstrap_packages = self.xml_state.get_bootstrap_packages()
     bootstrap_packages.append(
         self.xml_state.get_package_manager()
     )
     collection_type = self.xml_state.get_bootstrap_collection_type()
     log.info('--> collection type: %s', collection_type)
     bootstrap_collections = self.xml_state.get_bootstrap_collections()
     bootstrap_products = self.xml_state.get_bootstrap_products()
     bootstrap_archives = self.xml_state.get_bootstrap_archives()
     # process package installations
     if collection_type == 'onlyRequired':
         manager.process_only_required()
     all_install_items = self.__setup_requests(
         manager,
         bootstrap_packages,
         bootstrap_collections,
         bootstrap_products
     )
     process = CommandProcess(
         command=manager.process_install_requests_bootstrap(),
         log_topic='bootstrap'
     )
     try:
         process.poll_show_progress(
             items_to_complete=all_install_items,
             match_method=process.create_match_method(
                 manager.match_package_installed
             )
         )
     except Exception as e:
         raise KiwiBootStrapPhaseFailed(
             'Bootstrap package installation failed: %s' % format(e)
         )
     manager.dump_reload_package_database()
     # process archive installations
     if bootstrap_archives:
         try:
             self.__install_archives(bootstrap_archives)
         except Exception as e:
             raise KiwiBootStrapPhaseFailed(
                 'Bootstrap archive installation failed: %s' % format(e)
             )
Exemplo n.º 4
0
 def install_packages(self, manager, packages):
     """
         install one or more packages using the package manager inside
         of the new root directory
     """
     log.info('Installing system packages (chroot)')
     all_install_items = self.__setup_requests(manager, packages)
     if all_install_items:
         process = CommandProcess(
             command=manager.process_install_requests(), log_topic='system')
         try:
             process.poll_show_progress(
                 items_to_complete=all_install_items,
                 match_method=process.create_match_method(
                     manager.match_package_installed))
         except Exception as e:
             raise KiwiSystemInstallPackagesFailed(
                 'Package installation failed: %s' % format(e))
Exemplo n.º 5
0
 def install_system(self, manager):
     """
         install system software using the package manager inside
         of the new root directory. This is done via a chroot operation
         and requires the desired package manager to became installed
         via the bootstrap phase
     """
     log.info('Installing system (chroot) for build type: %s',
              self.xml_state.get_build_type_name())
     collection_type = self.xml_state.get_system_collection_type()
     log.info('--> collection type: %s', collection_type)
     system_packages = self.xml_state.get_system_packages()
     system_collections = self.xml_state.get_system_collections()
     system_products = self.xml_state.get_system_products()
     system_archives = self.xml_state.get_system_archives()
     # process package installations
     if collection_type == 'onlyRequired':
         manager.process_only_required()
     all_install_items = self.__setup_requests(manager, system_packages,
                                               system_collections,
                                               system_products)
     if all_install_items:
         process = CommandProcess(
             command=manager.process_install_requests(), log_topic='system')
         try:
             process.poll_show_progress(
                 items_to_complete=all_install_items,
                 match_method=process.create_match_method(
                     manager.match_package_installed))
         except Exception as e:
             raise KiwiInstallPhaseFailed(
                 'System package installation failed: %s' % format(e))
     # process archive installations
     if system_archives:
         try:
             self.__install_archives(system_archives)
         except Exception as e:
             raise KiwiInstallPhaseFailed(
                 'System archive installation failed: %s' % format(e))
Exemplo n.º 6
0
 def install_bootstrap(self, manager):
     """
         install system software using the package manager
         from the host, also known as bootstrapping
     """
     log.info('Installing bootstrap packages')
     bootstrap_packages = self.xml_state.get_bootstrap_packages()
     bootstrap_packages.append(self.xml_state.get_package_manager())
     collection_type = self.xml_state.get_bootstrap_collection_type()
     log.info('--> collection type: %s', collection_type)
     bootstrap_collections = self.xml_state.get_bootstrap_collections()
     bootstrap_products = self.xml_state.get_bootstrap_products()
     bootstrap_archives = self.xml_state.get_bootstrap_archives()
     # process package installations
     if collection_type == 'onlyRequired':
         manager.process_only_required()
     all_install_items = self.__setup_requests(manager, bootstrap_packages,
                                               bootstrap_collections,
                                               bootstrap_products)
     process = CommandProcess(
         command=manager.process_install_requests_bootstrap(),
         log_topic='bootstrap')
     try:
         process.poll_show_progress(
             items_to_complete=all_install_items,
             match_method=process.create_match_method(
                 manager.match_package_installed))
     except Exception as e:
         raise KiwiBootStrapPhaseFailed(
             'Bootstrap package installation failed: %s' % format(e))
     manager.dump_reload_package_database()
     # process archive installations
     if bootstrap_archives:
         try:
             self.__install_archives(bootstrap_archives)
         except Exception as e:
             raise KiwiBootStrapPhaseFailed(
                 'Bootstrap archive installation failed: %s' % format(e))