[yum-commits] repoquery.py
James Antill
james at osuosl.org
Fri May 21 13:59:41 UTC 2010
repoquery.py | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
New commits:
commit 8977743463bae1e304d06558954dac917fbc7ed0
Author: James Antill <james at and.org>
Date: Fri May 21 09:59:33 2010 -0400
Add errormsg for bad repofrompath argument, make repoid not found an error
diff --git a/repoquery.py b/repoquery.py
index ab0ec52..d5c33f9 100755
--- a/repoquery.py
+++ b/repoquery.py
@@ -793,7 +793,11 @@ def main(args):
if opts.repofrompath:
# setup the fake repos
for repo in opts.repofrompath:
- repoid,repopath = tuple(repo.split(','))
+ tmp = tuple(repo.split(','))
+ if len(tmp) != 2:
+ repoq.logger.error("Error: Bad repofrompath argument: %s" %repo)
+ continue
+ repoid,repopath = tmp
if repopath[0] == '/':
baseurl = 'file://' + repopath
else:
@@ -834,9 +838,8 @@ def main(args):
else:
found_repos.add(repo.id)
repo.enable()
- if not opts.quiet:
- for not_found in set(opts.repoid).difference(found_repos):
- repoq.logger.info('Repoid %s was not found.' % not_found)
+ for not_found in set(opts.repoid).difference(found_repos):
+ repoq.logger.error('Repoid %s was not found.' % not_found)
if opts.disablerepos:
for repo_match in opts.disablerepos:
More information about the Yum-commits
mailing list