def __init__(self): YumUtilBase.__init__(self, YumBuildDep.NAME, YumBuildDep.VERSION, YumBuildDep.USAGE) self.logger = logging.getLogger("yum.verbose.cli.yumbuildep") # Add util commandline options to the yum-cli ones self.optparser = self.getOptionParser() if hasattr(rpm, "reloadConfig"): self.optparser.add_option("--target", help="set target architecture for spec parsing") self.main()
def __init__(self): YumUtilBase.__init__(self, PackageCleanup.NAME, PackageCleanup.VERSION, PackageCleanup.USAGE) self.logger = logging.getLogger("yum.verbose.cli.packagecleanup") # Add util commandline options to the yum-cli ones self.optparser = self.getOptionParser() self.optparser_grp = self.getOptionGroup() self.addCmdOptions() self.main()
def __init__(self): YumUtilBase.__init__(self, YumBuildDep.NAME, YumBuildDep.VERSION, YumBuildDep.USAGE) self.logger = logging.getLogger("yum.verbose.cli.yumbuildep") # Add util commandline options to the yum-cli ones self.optparser = self.getOptionParser() if hasattr(rpm, 'reloadConfig'): self.optparser.add_option( "--target", help="set target architecture for spec parsing") self.main()
def __init__(self): YumUtilBase.__init__(self, YumDownloader.NAME, YumDownloader.VERSION, YumDownloader.USAGE) self.logger = logging.getLogger("yum.verbose.cli.yumdownloader") self.localPackages = [] # Add util commandline options to the yum-cli ones self.optparser = self.getOptionParser() self.main()
def __init__(self): YumUtilBase.__init__(self, YumDownloader.NAME, YumDownloader.VERSION, YumDownloader.USAGE) self.logger = logging.getLogger("yum.verbose.cli.yumdownloader") self.localPackages = [] # Add util commandline options to the yum-cli ones self.optparser = self.getOptionParser() try: self.main() except (OSError, IOError), e: self.logger.error(exception2msg(e)) sys.exit(1)
def __init__(self): YumUtilBase.__init__(self, YumCompleteTransaction.NAME, YumCompleteTransaction.VERSION, YumCompleteTransaction.USAGE) self.logger = logging.getLogger("yum.verbose.cli.yumcompletets") # Add util commandline options to the yum-cli ones self.optparser = self.getOptionParser() if hasattr(self, 'getOptionGroup'): self.optparser_grp = self.getOptionGroup() else: self.optparser_grp = self.optparser self.addCmdOptions() self.main()
def __init__(self): self._checks = {} # Register checks self.registerCheck(TestCheck()) # setup the base YumUtilBase.__init__(self, RepoCheck.NAME, RepoCheck.VERSION, self._makeUsage()) self.logger = logging.getLogger("yum.verbose.cli.repo-check") # get the parser self.optparser = self.getOptionParser() self.main()
def __init__(self): YumUtilBase.__init__(self, YumSafeUpdate.NAME, YumSafeUpdate.VERSION, YumSafeUpdate.USAGE) self.logger = logging.getLogger("yum.verbose.cli.safe-update") self.good_packages = set() self.bad_packages = set() self.errors_msgs = {} self.opts = None self.setup() self.check_updates() if not self.updates: self.logger.info("No available updates") return self.show_result() if not self.opts.check_only: self.update_good_packages()
def __init__(self): YumUtilBase.__init__(self, DebugInfoInstall.NAME, DebugInfoInstall.VERSION, DebugInfoInstall.USAGE) self.logger = logging.getLogger("yum.verbose.cli.debuginfoinstall") self.optparser = self.getOptionParser() opts = self.optparser # Add util commandline options to the yum-cli ones if hasattr(self, 'getOptionGroup'): opts = self.getOptionGroup() opts.add_option("", "--no-debuginfo-plugin", action="store_true", help="Turn off automatic installation/update of the yum debuginfo plugin") self.main()
def __init__(self): YumUtilBase.__init__(self, YumCompleteTransaction.NAME, YumCompleteTransaction.VERSION, YumCompleteTransaction.USAGE) self.logger = logging.getLogger("yum.verbose.cli.yumcompletets") # Add util commandline options to the yum-cli ones self.optparser = self.getOptionParser() if hasattr(self, 'getOptionGroup'): self.optparser_grp = self.getOptionGroup() else: self.optparser_grp = self.optparser self.addCmdOptions() try: self.main() finally: self.unlock()
def __init__(self): YumUtilBase.__init__(self, YumBuildDep.NAME, YumBuildDep.VERSION, YumBuildDep.USAGE) self.logger = logging.getLogger("yum.verbose.cli.yumbuildep") # Add util commandline options to the yum-cli ones self.optparser = self.getOptionParser() if hasattr(rpm, 'reloadConfig'): self.optparser.add_option( "--target", help="set target architecture for spec parsing") self.optparser.add_option( "--define", action="append", default=[], metavar="'MACRO EXPR'", help="define the rpm MACRO with value EXPR for spec parsing", ) self.main()
def __init__(self): YumUtilBase.__init__(self, YumBuildDep.NAME, YumBuildDep.VERSION, YumBuildDep.USAGE) self.logger = logging.getLogger("yum.verbose.cli.yumbuildep") # Add util commandline options to the yum-cli ones self.optparser = self.getOptionParser() if hasattr(rpm, 'reloadConfig'): self.optparser.add_option("--target", help="set target architecture for spec parsing") self.optparser.add_option( "--define", action="append", default=[], metavar="'MACRO EXPR'", help="define the rpm MACRO with value EXPR for spec parsing", ) self.main()
def _yb_no_pri(self): npyb = YumUtilBase(NAME, VERSION, USAGE) npyb.preconf.disabled_plugins = ['priorities'] npyb.preconf.quiet = True npyb.preconf.debuglevel = -1 npyb.preconf.errorlevel = -1 opt_prsr = OptionParser() npyb.preconf.optparser = opt_prsr npyb.conf.cache = os.geteuid() != 0 npyb.conf.disable_excludes = ['all'] opts, args = opt_prsr.parse_args([]) npyb.plugins.setCmdLine(opts, args) return npyb
def __init__(self): YumUtilBase.__init__(self, DebugInfoInstall.NAME, DebugInfoInstall.VERSION, DebugInfoInstall.USAGE) self.logger = logging.getLogger("yum.verbose.cli.debuginfoinstall") self.optparser = self.getOptionParser() opts = self.optparser # Add util commandline options to the yum-cli ones if hasattr(self, 'getOptionGroup'): opts = self.getOptionGroup() opts.add_option( "", "--no-debuginfo-plugin", action="store_true", help= "Turn off automatic installation/update of the yum debuginfo plugin" ) self.done = set() try: self.main() except yum.Errors.YumBaseError, e: print e sys.exit(1)
def _init_yumbase(self, name=NAME, ver=VERSION, usage=USAGE): yum_base = YumUtilBase(name, ver, usage) yum_base.preconf.disableplugin = [] yum_base.preconf.quiet = True yum_base.preconf.debuglevel = -1 yum_base.preconf.errorlevel = -1 yum_base.preconf.plugin_types = (plugins.TYPE_CORE, plugins.TYPE_INTERACTIVE) opt_prsr = OptionParser() yum_base.preconf.optparser = opt_prsr yum_base.conf.cache = os.geteuid() != 0 yum_base.conf.disable_excludes = [] opts, args = opt_prsr.parse_args([]) # The yum security plugin will crap pants if the plugin # cmdline isn't set up: yum_base.plugins.setCmdLine(opts, args) return yum_base
if name not in cfgOptions and option.default == value: continue ini[section_id][name] = ovalue fp =file(filename, "w") fp.write(str(ini)) fp.close() NAME = 'yum-config-manager' VERSION = '1.0' USAGE = '"yum-config-manager [options] [section]' yum.misc.setup_locale() yb = YumUtilBase(NAME, VERSION, USAGE) logger = logging.getLogger("yum.verbose.cli.yum-config-manager") yb.preconf.debuglevel = 0 yb.preconf.errorlevel = 0 yb.optparser = yb.getOptionParser() if hasattr(yb, 'getOptionGroup'): # check if the group option API is available group = yb.getOptionGroup() else: group = yb.optparser group.add_option("--save", default=False, action="store_true", help='save the current options (useful with --setopt)') group.add_option("--enable", default=False, action="store_true", help='enable the specified repos (automatically saves)') group.add_option("--disable", default=False, action="store_true", help='disable the specified repos (automatically saves)') group.add_option("--add-repo", default=[], dest='addrepo', action='append',
fp =file(filename, "w") fp.write(str(ini)) fp.close() def match_repoid(repoid, repo_setopts): for i in repo_setopts: if fnmatch.fnmatch(repoid, i): return True NAME = 'yum-config-manager' VERSION = '1.0' USAGE = 'yum-config-manager [options] [section ...]' yum.misc.setup_locale() yb = YumUtilBase(NAME, VERSION, USAGE) logger = logging.getLogger("yum.verbose.cli.yum-config-manager") yb.preconf.debuglevel = 0 yb.preconf.errorlevel = 0 yb.optparser = yb.getOptionParser() if hasattr(yb, 'getOptionGroup'): # check if the group option API is available group = yb.getOptionGroup() else: group = yb.optparser group.add_option("--save", default=False, action="store_true", help='save the current options (useful with --setopt)') group.add_option("--enable", default=False, action="store_true", help='enable the specified repos (automatically saves)') group.add_option("--disable", default=False, action="store_true", help='disable the specified repos (automatically saves)') group.add_option("--add-repo", default=[], dest='addrepo', action='append',
def doUtilConfigSetup(self, *args, **kwargs): """ We override this to get our extra option out. """ opts = YumUtilBase.doUtilConfigSetup(self, *args, **kwargs) self.no_debuginfo_plugin = opts.no_debuginfo_plugin return opts