Bug 435597 - Yum doesn't recognize repositories with spaces in the path.
Yum doesn't recognize repositories with spaces in the path.
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: yum (Show other bugs)
8
i386 Linux
low Severity low
: ---
: ---
Assigned To: Seth Vidal
Fedora Extras Quality Assurance
: Reopened
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-03-02 05:56 EST by Diego
Modified: 2014-01-21 18:02 EST (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-03-04 16:37:34 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Not working Fedora DVD ".repo" file (104 bytes, application/octet-stream)
2008-03-02 05:56 EST, Diego
no flags Details
Working Fedora DVD .repo file (107 bytes, application/octet-stream)
2008-03-02 08:07 EST, Diego
no flags Details

  None (edit)
Description Diego 2008-03-02 05:56:11 EST
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 05:56:11 EST
Created attachment 296505 [details]
Not working Fedora DVD ".repo" file
Comment 2 Diego 2008-03-02 06:06:24 EST
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 06:49:25 EST
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 07:19:18 EST
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 08:07:04 EST
Created attachment 296509 [details]
Working Fedora DVD .repo file
Comment 6 Diego 2008-03-02 08:08:38 EST
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-02 23:00:54 EST
 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 06:58:08 EST
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.

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