Bug 567887 - repoclosure breaks with relative paths
Summary: repoclosure breaks with relative paths
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: yum-utils
Version: 12
Hardware: x86_64
OS: Linux
low
medium
Target Milestone: ---
Assignee: Seth Vidal
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: abrt_hash:66407244
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-02-24 08:34 UTC by Kamil Páral
Modified: 2014-01-21 23:13 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-02-24 09:20:20 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
File: backtrace (725 bytes, text/plain)
2010-02-24 08:34 UTC, Kamil Páral
no flags Details

Description Kamil Páral 2010-02-24 08:34:57 UTC
abrt 1.0.6 detected a crash.

architecture: x86_64
cmdline: /usr/bin/python -t /usr/bin/repoclosure --repofrompath myrepo,. -t -r myrepo
comment: I ran repoclosure with "." denoting current directory. Maybe it's a bad syntax, but it should not certainly trigger ABRT showing crash, it should just report an error in the shell.
component: yum-utils
executable: /usr/bin/repoclosure
kernel: 2.6.31.12-174.2.3.fc12.x86_64
package: yum-utils-1.1.25-1.fc12
release: Fedora release 12 (Constantine)

backtrace
-----
Summary: TB66407244 config.py:94:__set__:ValueError: Error parsing '.': URL must be http, ftp, file or https not ""

Traceback (most recent call last):
  File "/usr/bin/repoclosure", line 276, in <module>
    main()
  File "/usr/bin/repoclosure", line 206, in main
    newrepo.baseurl = baseurl
  File "/usr/lib/python2.6/site-packages/yum/config.py", line 94, in __set__
    raise ValueError('Error parsing %r: %s' % (value, str(e)))
ValueError: Error parsing '.': URL must be http, ftp, file or https not ""

Local variables in innermost frame:
obj: <yum.yumRepo.YumRepository object at 0x1308e90>
self: <yum.config.UrlListOption object at 0xf2a9d0>
e: ValueError('URL must be http, ftp, file or https not ""',)
value: '.'

How to reproduce
-----
1. $ repoclosure --repofrompath myrepo,. -t -r myrepo
2.
3.

Comment 1 Kamil Páral 2010-02-24 08:34:59 UTC
Created attachment 395955 [details]
File: backtrace

Comment 2 Tim Lauridsen 2010-02-24 09:20:20 UTC
  --repofrompath=REPOFROMPATH
                        specify repoid & paths of additional repositories -
                        unique repoid and complete path required, can be
                        specified multiple times. Example.
                        --repofrompath=myrepo,/path/to/repo

You need to use the full path to the repo

Comment 3 Kamil Páral 2010-02-24 09:38:03 UTC
Yeah, I know now. The funny thing is that now that ABRT is widely deployed, Python developers will receive quite a lot automated bug reports if they keep not catching exceptions. I am just beginner in Python, but I also use tracebacks as an error output quite often. It's easier than to catch the exception and end the program anyway, and still it's readable. But it seems it will be necessary to catch all those exception for which you don't want to receive bug reports.

Just a thought, I'm not an expert in this.

Comment 4 seth vidal 2010-03-01 20:04:03 UTC
http://yum.baseurl.org/gitweb?p=yum-utils.git;a=commitdiff;h=b15cb0760c864cadc5029474d07cc38882ec1815

committed a change to catch these errors and tested it w/the above.

you're right, abrt will cause us more irritation and this is an easy catch.

Comment 5 Tim Lauridsen 2010-03-02 11:20:57 UTC
http://yum.baseurl.org/gitweb?p=yum-utils.git;a=commitdiff;h=94b52cb5499b47cb4e2b64c8a2e4e7863b2e965e

And i have fixed repoclosure to work with relative paths, really easy to fix :)


Note You need to log in before you can comment on or make changes to this bug.