Bug 426627

Summary: Cannot install package from Factory (because of repo with a space in its name?)
Product: [openSUSE] openSUSE 11.1 Reporter: Vincent Untz <vuntz>
Component: libzyppAssignee: E-mail List <zypp-maintainers>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None    
Version: Factory   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Vincent Untz 2008-09-16 14:36:09 UTC
lyon:/etc/zypp/repos.d # LANG=C LC_ALL=C zypper in -y gnome-backgrounds
Reading installed packages...

The following NEW package is going to be installed:
  gnome-backgrounds 


Overall download size: 9.4 M. After the operation, additional 9.6 M will be used.
Continue? [YES/no]: yes
Retrieving package gnome-backgrounds-2.23.92-4.noarch (1/1), 9.4 M (9.6 M unpacked)
Retrieving: gnome-backgrounds-2.23.92-4.noarch.rpm [done (761.1 K/s)]
Installing: gnome-backgrounds-2.23.92-4 [error]
Installation of gnome-backgrounds-2.23.92-4 failed:
(with --nodeps --force) Error: Subprocess failed. Error: RPM failed: error: open of /var/cache/zypp/packages/openSUSE-FACTORY\ failed: No such file or directory
error: open of 11.0/suse/noarch/gnome-backgrounds-2.23.92-4.noarch.rpm failed: No such file or directory


Abort, retry, ignore? [A/r/i]: a

I'll try to rename "openSUSE-FACTORY 11.0" to something without a space...
Comment 1 Vincent Untz 2008-09-16 14:39:52 UTC
Removing the space definitely helps.
Comment 2 Jan Kupec 2008-09-16 15:36:09 UTC
can you be more specific? what exactly did you do when you "removed the space"? I tried with an _alias_ containing the space, but that seems to work fine.
Comment 3 Vincent Untz 2008-09-16 15:48:41 UTC
Sorry, I thought it was clear. The repo was named 'openSUSE-FACTORY 11.0'. I wasn't the alias, but it's the identifier of the repo (which is on the first line of the .repo file) -- it's also what is used to identify data in /var/cache/zypp.
Comment 4 Jan Kupec 2008-09-16 16:07:03 UTC
Well, that actually _is_ the alias. So i wonder why it works for me. What exactly did you do to "remove the space"?

I looks to me more like an outdated metadata (zypper ref needed). If that's the case i would need to improve the output to include a hint to "run zypper ref". But first we should check whether this is the case.

------

$ zypper ar http://download.opensuse.org/update/11.0/ 'upd ff'
$ zypper ref 'upd ff'
Retrieving repository 'upd ff' metadata [done]
Building repository 'upd ff' cache [done]
Specified repositories have been refreshed.

$ zypper ar --name "Foo Repo" http://download.opensuse.org/update/11.0/ 'upd ff'
$ zypper ref 'upd ff'
Retrieving repository 'Foo Repo' metadata [done]
Building repository 'Foo Repo' cache [done]
Specified repositories have been refreshed.
$ zypper install -r 'upd ff' rxvt-unicode
Reading installed packages...

The following NEW package is going to be installed:
  rxvt-unicode


Overall download size: 955.0 K. After the operation, additional 2.9 M will be used.
Continue? [YES/no]:
Retrieving package rxvt-unicode-9.02-14.2.x86_64 (1/1), 955.0 K (2.9 M unpacked)
Retrieving: rxvt-unicode-9.02-14.2.x86_64.rpm [done]
Installing: rxvt-unicode-9.02-14.2 [done]
Comment 5 Vincent Untz 2008-09-16 16:41:30 UTC
(In reply to comment #4 from Ján Kupec)
> Well, that actually _is_ the alias. So i wonder why it works for me. What
> exactly did you do to "remove the space"?

I used vim to edit /etc/zypp/repos.d/filename.repo and changed [openSUSE-FACTORY 11.0] to [openSUSE-FACTORY]

> I looks to me more like an outdated metadata (zypper ref needed). If that's the
> case i would need to improve the output to include a hint to "run zypper ref".
> But first we should check whether this is the case.

Nope, I ran 'zypper refresh' without success.

[...]

Not sure why it doesn't happen to you. I'm using zypper from factory, fwiw.

Note that the error itself seems explicit:

(with --nodeps --force) Error: Subprocess failed. Error: RPM failed: error:
open of /var/cache/zypp/packages/openSUSE-FACTORY\ failed: No such file or
directory
error: open of 11.0/suse/noarch/gnome-backgrounds-2.23.92-4.noarch.rpm failed:
No such file or directory

It looks as if "/var/cache/zypp/packages/openSUSE-FACTORY\" and "11.0/suse/noarch/gnome-backgrounds-2.23.92-4.noarch.rpm" are two separate arguments while they shouldn't only be one.
Comment 6 Jan Kupec 2008-09-28 18:07:14 UTC
OK, i was able to reproduce this. It fails only when installing the package with rpm, not when refreshing the data.

I've found the following comment in http://svn.opensuse.org/svn/zypp/trunk/libzypp/zypp/target/rpm/RpmDb.cc

#if 1 // No more need to escape whitespace since rpm-4.4.2.3
const char* quoteInFilename_m = "\'\"";
#else
const char* quoteInFilename_m = " \t\'\"";
#endif


And indeed, upgrading to rpm-4.4.2.3-5.5 from current factory makes the problem go away :O)