Bug 433679

Summary: zypper -C broken in specific cases
Product: [openSUSE] openSUSE 11.0 Reporter: Forgotten User QPz6RCyXU0 <forgotten_QPz6RCyXU0>
Component: YaST2Assignee: Jan Kupec <jkupec>
Status: RESOLVED FIXED QA Contact: Jiri Srain <jsrain>
Severity: Normal    
Priority: P3 - Medium CC: ast, bitdealer, dmacvicar, hmuelle, kkaempf, schubi, zypp-maintainers
Version: Final   
Target Milestone: ---   
Hardware: Other   
OS: openSUSE 11.0   
Whiteboard: maint:released:11.0:23904 maint:released:11.1:24006
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Forgotten User QPz6RCyXU0 2008-10-08 20:57:01 UTC
It seems that the following functionality

zypper in -C 'perl(Regexp::Common)'

breaks while parsing the arguments in opensuse 11.0, while it worked just fine in opensuse 10.3.


~ # LANG=CC zypper -v in -C 'perl(Regexp::Common)'
Verbosity: 1
Non-option program arguments: 'perl(Regexp::Common)'
Initializing Target
Reading installed packages...
Force resolution: Yes
Resolving dependencies...
'Common)' not found
Force resolution: Yes
Resolving dependencies...
Nothing to do.


While the following syntax still works as expected:

~ # LANG=CC zypper -v wp 'perl(Regexp::Common)'
Verbosity: 1
Non-option program arguments: 'perl(Regexp::Common)'
Initializing Target
Downloading: repomd.xml [done]
Reading installed packages...
S | Name               | Type    | Version     | Arch   | Repository
--+--------------------+---------+-------------+--------+-----------------------------
  | perl-Regexp-Common | package | 2.120-110.1 | x86_64 | suse11.0-oss
  | perl-Regexp-Common | package | 2.120-110.1 | i586   | suse11.0-oss


We'd be happy to provide any additional details that would help,
thanks!
Comment 1 Jan Kupec 2008-10-09 16:17:21 UTC
Thanx! I can reproduce the problem. It is because zypper treats the first part of the string until the last colon as an alias of repository from which to install the "Common" (the remainder of the string) package.

There are several ways how to solve this, a few come to my mind:

1) don't expect 'repository:capability' argument if -C is explicitly
   specified, treat the whole string as 'capability'
2) add new option to disable this 'repository:capability' feature 
3) add some argument modifier e.g. '~ccapability' that would make zypper
   treat the string until the end or until another modifier as the capability.
   There could also be modifiers for repoalias, arch,
   e.g. '~rfactory~ai686~npackagename'
   This might even solve bug 404048 (problem how to tell zypper to install
   package with an epoch number - foo-1:1.2.3) and probably other problems!

Suggestions?
Comment 2 Michael Schröder 2008-10-11 15:25:46 UTC
I'd prefer 1), i.e. get rid of that repository:capability hack. That's what the '-r' option is for.

(Plus, I'm strongly against option 3. *shudder*)
Comment 3 Jan Kupec 2008-10-11 16:15:31 UTC
(In reply to comment #2 from Michael Schroeder)
> I'd prefer 1), i.e. get rid of that repository:capability hack. That's what the
> '-r' option is for.

There are two differences: first, -r puts the rest of your repos (the ones you don't specify) out of play (they can't be used e.g. to satisfy deps), second, you can't specify repo per package with -r.
Comment 4 Michael Schröder 2008-10-13 08:18:31 UTC
Uh, ok. Not very intuitive, though. I would have though that '-r' just limits the packages from the command line. What if some package needs a library from the main repo?

Regarding your second argument: what are the use cases for "repo per package"?
Comment 5 Stephan Kleine 2009-03-09 13:45:42 UTC
Any news on this? AFAIK it's still broken on 11.1 but I would really love to see this back since it makes it much easier to install any needed perl modules.

Regarding how to solve this, IMHO all 3 suggested solutions don't sound really right (especially #3 ;D). Zypper should simply recognize quotation marks (' & ") and treat everything enclosed in them as one string.

That way someting like

zypper in 'perl(Regexp::Common)'

or

zypper in 'some:strange:::repo_alias':'perl(Regexp::Common)'

would be valid. Also it should be possible to simply escape any special characters - like e.g.:

zypper in perl(Regexp\:\:Common)

instead of using quotation marks.

That sounds like the most natural solution to me. Or am I missing something?
Comment 6 Michael Schröder 2009-03-09 13:52:30 UTC
As we now have '--from' in zypper, I don't see why we can't get rid of that repository-by-capability hack. Who needs repo per package?

(Uh, the man page says that --from implies --name, why is that the case?)
Comment 7 Jan Kupec 2009-03-09 14:21:48 UTC
(In reply to comment #6)
> As we now have '--from' in zypper, I don't see why we can't get rid of that
> repository-by-capability hack. Who needs repo per package?

It was requested in FATE #302919. I agree it's a corner case, maybe nobody used it so far :O)

> (Uh, the man page says that --from implies --name, why is that the case?)

Because of insufficient solver API in libzypp. We'd need and API to install by name/capability while enforcing specific repository. Schubi, could this be provided? This is one of examples of what's needed that i mentioned in http://lists.opensuse.org/zypp-devel/2009-03/msg00012.html - yes, i'll send detailed list later.
Comment 8 Jan Kupec 2009-04-15 09:29:21 UTC
I fixed this the easiest possible way for now: if the requested string starts with 'perl(', zypper won't try to parse the string into a repo:packagename. The same if -C option is specified (we can't force repo if installing by capability now anyway).

http://git.opensuse.org/?p=projects/zypp/zypper.git;a=commitdiff;h=4f8ae8ffcf64759808dc20a2775358dec15428f4

We'll deal with this more intelligently later.

Fixed in git repo. To be in zypper 1.2.0 for openSUSE 11.2.

@Sysadmin VBI: do you want this fix also in 11.0 or 11.1?
Comment 9 Forgotten User QPz6RCyXU0 2009-04-15 09:50:58 UTC
(In reply to comment #8)

> @Sysadmin VBI: do you want this fix also in 11.0 or 11.1?

It would be really great to see this fix available in 11.0 and 11.1, seeing as they won't EOL for some time now, and we have dozens of servers deployed with those releases. I'm certain other folks would also welcome this fix. 

Thank you!
Comment 11 Jan Kupec 2009-04-15 13:02:19 UTC
OK, submitted for 11.0, 11.1 :O)

11.2 (zypper 1.2.0) later.
Comment 12 Duncan Mac-Vicar 2009-04-15 15:36:57 UTC
The fix is on the queue for SLE and openSUSE 11.1 as well.
Comment 13 Swamp Workflow Management 2009-04-21 15:08:38 UTC
Update released for: zypper
Products:
openSUSE 11.0 (debug, i386, ppc, x86_64)
Comment 14 Swamp Workflow Management 2009-05-04 14:17:26 UTC
Update released for: PackageKit, PackageKit-debuginfo, PackageKit-debugsource, PackageKit-devel, PackageKit-lang, gnome-packagekit, gnome-packagekit-debuginfo, gnome-packagekit-debugsource, gnome-packagekit-lang, libpackagekit-glib10, libpackagekit-glib10-devel, libpackagekit-qt10, libpackagekit-qt10-devel, libqdialogsolver1, libqdialogsolver1-debuginfo, libqdialogsolver1-debugsource, libqdialogsolver1-devel, libsatsolver, libsatsolver-debuginfo, libsatsolver-debugsource, libsatsolver-devel, libzypp, libzypp-debuginfo, libzypp-debugsource, libzypp-devel, perl-satsolver, python-satsolver, ruby-satsolver, satsolver-tools, yast2-pkg-bindings, yast2-pkg-bindings-debuginfo, yast2-pkg-bindings-debugsource, yast2-pkg-bindings-devel-doc, yast2-qt-pkg, yast2-qt-pkg-debuginfo, yast2-qt-pkg-debugsource, zypper, zypper-debuginfo, zypper-debugsource
Products:
openSUSE 11.1 (debug, i586, ppc, x86_64)