Bug 250990

Summary: rpm does not work with directories that contain spaces
Product: [Fedora] Fedora Reporter: Till Maas <opensource>
Component: rpmAssignee: Panu Matilainen <pmatilai>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: low    
Version: 7CC: david.monniaux, tbeattie, trevin, ville.skytta
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-01-25 17:37:29 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:

Description Till Maas 2007-08-06 13:16:40 UTC
Description of problem:
When I am in the directory "~/devel/EPEL Groups" and want to extract
buildsys-macros-5-4.el5.noarch.rpm then I get this error:
$ rpmdev-extract buildsys-macros-5-4.el5.noarch.rpm 
error: open of /home/till/devel/EPEL failed: No such file or directory
error: open of /home/till/devel/EPEL failed: No such file or directory
mkdir: cannot create directory `': No such file or directory

Version-Release number of selected component (if applicable):
rpmdevtools-5.4-1.fc7

How reproducible:
always

Comment 1 Ville Skyttä 2007-08-06 13:50:20 UTC
Looks like a rpm bug to me:

$ mkdir -p "devel/EPEL Groups"
$ cd "devel/EPEL Groups"
$ wget -q
http://buildsys.fedoraproject.org/buildgroups/rhel5/i386/buildsys-macros-5-4.el5.noarch.rpm

$ rpm -qp --qf '%{NAME}-%{VERSION}-%{RELEASE}'
"$PWD/buildsys-macros-5-4.el5.noarch.rpm"
error: open of /home/scop/devel/EPEL failed: No such file or directory
error: open of /home/scop/devel/EPEL failed: No such file or directory

$ rpm -Uvh "$PWD/buildsys-macros-5-4.el5.noarch.rpm"
error: open of /home/scop/devel/EPEL failed: No such file or directory
error: open of Groups/buildsys-macros-5-4.el5.noarch.rpm failed: No such file or
directory

$ rpm -q rpm
rpm-4.4.2-46.fc7.x86_64

Also, the exit status of the failing "rpm -qp ..." command above is 0, so I
can't use that do detect failures in rpmdev-extract.  I think it should be
changed to indicate failure if there is one.

Comment 2 Panu Matilainen 2007-08-06 14:06:00 UTC
Mostly a dupe of bug #217258 but the incorrect exit status not mentioned there...

Comment 4 Red Hat Bugzilla 2007-08-21 05:35:36 UTC
User pnasrat's account has been closed

Comment 5 Panu Matilainen 2007-10-25 11:13:09 UTC
*** Bug 217258 has been marked as a duplicate of this bug. ***

Comment 6 Trevin Beattie 2008-01-19 14:55:39 UTC
I was about to enter a new bug until I found this one.

I've just installed FC8 in a VMware instance to try it out.

Description of problem:
If I hand rpm a path to a package that has a space in the name, rpm treats it as
two arguments separated by the space instead of one, even though the space is
either escaped or quoted.

This was spotted on a VMware installation where the VMware Tools are mounted on
"/media/VMware Tools" by default.

Version-Release number of selected component (if applicable):
4.4.2.2-3.fc8, 4.4.2.2-7.fc8, 4.4.2-32 (fc6), and 4.4.2-37.el5

How reproducible:
Every time

Steps to Reproduce:
1. # touch '/tmp/test rpm-1.0-1.noarch.rpm'
2a. # rpm -ivh '/tmp/test rpm-1.0-1.noarch.rpm'
2b. # rpm -ivh /tmp/test\ rpm-1.0-1.noarch.rpm
  
Actual results:
error: open of /tmp/test failed: No such file or directory
error: open of rpm-1.0-1.noarch.rpm failed: No such file or directory

Expected results:
/tmp/test rpm-1.0-1.noarch.rpm: not an rpm package (or package manifest):

Additional info:
I can confirm that this bug also exists on Fedora Core 6 and Red Hat Enterprise
Linux 5 (at work).


Comment 7 Trevin Beattie 2008-01-19 15:02:01 UTC
This is a very old bug -- I can also confirm that it existed on RHEL 3
(rpm-4.2.3-30_nonptl).


Comment 8 Panu Matilainen 2008-01-25 17:37:29 UTC
Fixed in 4.4.2.3-0.1.rc1:

[pmatilai@localhost ~]$ rpm -qp --qf "%{name} %{version}\n" ~/"dir with
spaces"/SRPMS/*
file 4.21
popt 1.12