Bug 435597

Summary: Yum doesn't recognize repositories with spaces in the path.
Product: [Fedora] Fedora Reporter: Diego <diego.ml>
Component: yumAssignee: Seth Vidal <skvidal>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: low    
Version: 8CC: ffesti, james.antill, katzj, pmatilai, tim.lauridsen
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-03-04 21:37:34 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Not working Fedora DVD ".repo" file
none
Working Fedora DVD .repo file none

Description Diego 2008-03-02 10:56:11 UTC
Description of problem:
Fedora 8 DVD is labeled as "Fedora 8 i386 DVD" so it is mounted in
"/media/Fedora\ 8\ i386\ DVD/". Trying to add it as a local repository results
in an error (probably) because of the spaces in the name.

Version-Release number of selected component (if applicable):
Fedora -- version 8 with all updates as of 02 march 2008
yum -- version 3.2.8

How reproducible:
Set up a local repository with Fedora 8 DVD as the attachment below and then run
"yum list available" as root.

Using GUI and inserting "file:///media/Fedora\ 8\ i386\ DVD/" results in:

file:///media/Fedora%5C%208%5C%20i386%5C%20DVD/repodata/repomd.xml: [Errno 5]
OSError: [Errno 2] No such file or directory: '/media/Fedora\\ 8\\ i386\\
DVD/repodata/repomd.xml'

Trying several options for representing spaces but results are always negative;
using "file:///media/Fedora\ 8\ i386\ DVD/" inserted from command line with vi
results in:

Options Error: Error parsing 'file:///media/Fedora\\ 8\\ i386\\ DVD/': URL must
be http, ftp, file or https not ""

or, without "\":

Options Error: Error parsing 'file:///media/Fedora 8 i386 DVD/': URL must be
http, ftp, file or https not ""

or, using the same line as /etc/mtab, "/media/Fedora\0408\040i386\040DVD/"
results in:

file:///media/Fedora%5C0408%5C040i386%5C040DVD/repodata/repomd.xml: [Errno 5]
OSError: [Errno 2] No such file or directory:
'/media/Fedora\\0408\\040i386\\040DVD/repodata/repomd.xml'

so I think there are some problems in parsing path with spaces in it.

Steps to Reproduce:
1. insert official DVD or CD or a local repo with spaces in the path;
2. add it as a local repository;
3. try to use it.
  
Actual results:
The repo doesn't get recognized.

Expected results:
Adding the DVD should be a simple (and intuitive) operation. Now it is a
headache. What about adding an rpm in the root of the CD / DVD that helps to
install it as a local repository?

Additional info:
Unmounting the DVD and mounting in a directory without spaces in the name and
correcting the .repo file accordingly results in the repo working perfectly.

Comment 1 Diego 2008-03-02 10:56:11 UTC
Created attachment 296505 [details]
Not working Fedora DVD ".repo" file

Comment 2 Diego 2008-03-02 11:06:24 UTC
Mmm... sorry... another try solved the problem: inserting in the GUI the line
"file:///media/Fedora 8 i386 DVD/" results in successfully adding the local
repository. However the whole procedure is quite counterintuitive and it is
quite easy to make mistakes (for example because Konqueror opens the DVD as
"system:/media/sr1", but Pirut doesn't support this kind of addresses).

Comment 3 Diego 2008-03-02 11:49:25 UTC
Sorry... I recorrect myself. For some strange reason Pirut didn't give errore
when I first entered the repo as "file:///media/Fedora 8 i386 DVD/" but packages
are not listed and now I get the previous error so I reopen the bug as it is not
solved.

Comment 4 Seth Vidal 2008-03-02 12:19:18 UTC
in your yum repo file try this:

file:///media/Fedora%208%20i386%20DVD/

see if that does it for you.


Comment 5 Diego 2008-03-02 13:07:04 UTC
Created attachment 296509 [details]
Working Fedora DVD .repo file

Comment 6 Diego 2008-03-02 13:08:38 UTC
Thank you... that works. However the whole thing should be managed in a better way.

For example this is what I experienced:
adding the line you suggested me in Pirut triggered the same error. I looked
into the .repo file and found that it generated this line:
baseurl = file:///media/Fedora%25208%2520i386%2520DVD/
I fixed manually with the value you gave me and now it work perfectly. I looked
back into Pirut and it showed: "file:///media/Fedora 8 i386 DVD/". I remodified
it with the "%20"s and it continued to work (???), although in the .repo file
there is the wrong line:
baseurl = file:///media/Fedora%25208%2520i386%2520DVD/
I then tried to put a random (and not valid) path string in Pirut and it
continued to work. That means that if you modify a (working) repository from
within Pirut it doesn't check for correctness anymore until you restart it.
Should I file a bug report against Pirut?

I attached the working .repo file.

Comment 7 James Antill 2008-03-03 04:00:54 UTC
 This is a "feature" of yum, if yum has loaded the metadata from a repo. and you
change the repo. path then yum doesn't care and won't use it because all the
repo. MD is already there (even if you get a package from a repo. the path and
url to the package is already in memory, so again it won't consult the repo. dir
path).

 We could either check the path in pirut, or even do some kind of re-test in yum
itself ... but atm. it's expected behaviour.


Comment 8 Diego 2008-03-04 11:58:08 UTC
I found a much straightforward method to use the installation DVD: just copy the
"media.repo" included in the root of the DVD to /etc/yum.repos.d/.
However there should be a simpler graphical way from Pirut to add CD / DVD medias.

I think this bug could be closed.