• Home
  • Raw
  • Download

Lines Matching +full:class +full:- +full:utils

9 implement the given backend class.
15 @copyright: IBM 2008-2009
16 @copyright: Red Hat 2009-2010
25 from autotest_lib.client.bin import os_dep, utils
42 length -= 1
46 class SoftwareManagerLoggingConfig(logging_config.LoggingConfig):
57 class SystemInspector(object):
59 System inspector class.
68 self.distro = utils.get_os_vendor()
69 self.high_level_pms = ['apt-get', 'yum', 'zypper']
92 if 'apt-get' in list_supported and self.distro in ['Debian', 'Ubuntu']:
93 pm_supported = 'apt-get'
103 class SoftwareManager(object):
108 uses the concept of a backend, a helper class that implements the set of
113 Class constructor.
124 elif backend_type == 'apt-get':
224 class RpmBackend(object):
226 This class implements operations executed with the rpm package manager.
242 cmd = (self.lowlevel_base_cmd + ' -q --qf %{VERSION} ' + name +
244 inst_version = utils.system_output(cmd)
261 cmd = (self.lowlevel_base_cmd + ' -q --qf %{ARCH} ' + name +
263 inst_archs = utils.system_output(cmd)
274 cmd = 'rpm -q ' + name + ' 2> /dev/null'
282 installed_packages = utils.system_output('rpm -qa').splitlines()
294 option = '-qlp'
297 option = '-ql'
302 result = utils.system_output(l_cmd)
309 class DpkgBackend(object):
311 This class implements operations executed with the dpkg package manager.
322 n_cmd = (self.lowlevel_base_cmd + ' -f ' + name +
324 name = utils.system_output(n_cmd)
325 i_cmd = self.lowlevel_base_cmd + ' -s ' + name + ' 2>/dev/null'
327 package_status = utils.system_output(i_cmd, ignore_status=True)
328 not_inst_pattern = re.compile('not-installed', re.IGNORECASE)
340 raw_list = utils.system_output('dpkg -l').splitlines()[5:]
344 installed_packages.append("%s-%s" % (parts[1], parts[2]))
355 l_cmd = self.lowlevel_base_cmd + ' -c ' + package
357 l_cmd = self.lowlevel_base_cmd + ' -l ' + package
358 return utils.system_output(l_cmd).split('\n')
361 class YumBackend(RpmBackend):
375 base_arguments = '-y'
380 y_cmd = executable + ' --version | head -1'
381 self.yum_version = utils.system_output(y_cmd, ignore_status=True)
391 utils.system("yum clean all")
407 utils.system(i_cmd)
421 utils.system(r_cmd)
472 utils.system(r_cmd)
493 class ZypperBackend(RpmBackend):
504 self.base_command = os_dep.command('zypper') + ' -n'
505 z_cmd = self.base_command + ' --version'
506 self.zypper_version = utils.system_output(z_cmd, ignore_status=True)
518 i_cmd = self.base_command + ' install -l ' + name
520 utils.system(i_cmd)
534 utils.system(ar_cmd)
548 utils.system(rr_cmd)
561 utils.system(r_cmd)
571 u_cmd = self.base_command + ' update -l'
574 utils.system(u_cmd)
586 p_cmd = self.base_command + ' what-provides ' + name
589 p_output = utils.system_output(p_cmd).split('\n')[4:]
609 class AptBackend(DpkgBackend):
621 executable = os_dep.command('apt-get')
622 self.base_command = executable + ' -y'
624 self.apt_version = utils.system_output('apt-get -v | head -1',
640 utils.system(i_cmd)
653 flag = '--purge'
657 utils.system(r_cmd)
702 utils.system(ud_cmd)
708 utils.system(up_cmd)
720 if not self.check_installed('apt-file'):
721 self.install('apt-file')
722 command = os_dep.command('apt-file')
725 utils.system(cache_update_cmd, ignore_status=True)
730 provides = utils.system_output(fu_cmd).split('\n')
755 "usage: %prog [install|remove|list-all|list-files|add-repo|remove-repo|"
756 "upgrade|what-provides|install-what-provides] arguments")
757 parser.add_option('--verbose', dest="debug", action='store_true',
769 action = 'show-help'
775 if action == 'list-all':
777 elif action == 'list-files':
779 elif action == 'add-repo':
781 elif action == 'remove-repo':
785 elif action == 'what-provides':
787 elif action == 'install-what-provides':
789 elif action == 'show-help':