On Tue, 2010-08-03 at 11:23 -0400, James Antill wrote: > --- > yumcommands.py | 37 ++++++++++++++++++++++++++++++++++++- > 1 files changed, 36 insertions(+), 1 deletions(-) > > diff --git a/yumcommands.py b/yumcommands.py > index a7f5d9e..9c6fc75 100644 > --- a/yumcommands.py > +++ b/yumcommands.py > @@ -122,6 +122,25 @@ def checkShellArg(base, basecmd, extcmds): > base.usage() > raise cli.CliError > > +def checkEnabledRepo(base, possible_local_files=[]): > + """ > + Verify that there is at least one enabled repo. > + > + @param base: a YumBase object. > + """ > + if base.repos.listEnabled(): > + return > + > + for lfile in possible_local_files: > + if lfile.endswith(".rpm") and os.path.exists(lfile): > + return > + > + msg = _('There are no enabled repos.\n' > + ' Run "yum repolist all" to see the repos you have.\n' > + ' You can enable repos with yum-config-manager --enable <repo>') > + base.logger.critical(msg) > + raise cli.CliError > +
ACK. -sv _______________________________________________ Yum-devel mailing list Yum-devel@lists.baseurl.org http://lists.baseurl.org/mailman/listinfo/yum-devel