'zypper wp' - strange behaviour

I’ve noticed some strange behaviour of the ‘what-provides’ command of zypper.

Example:
'zypper wp ‘/usr/bin/mc’ should find what rpm package provides the command ‘mc’.

which mc
/usr/bin/mc
zypper wp '/usr/bin/mc'
Loading repository data...
Reading installed packages...
No providers of '/usr/bin/mc' found.

Now I discovered that some programs that have a symlink from /usr/bin to /bin are found by ‘zypper wp’ and some not. I can’t find any regularity for this behaviour. I’m not sure where gets zypper the info for ‘wp’. I believe it is stored in some metadata retrieved from the repos. So I don’t think it is a zypper bug. But I have no clue where the infos about provides come from, perhaps a failure of some package maintainers?

Thanks for some infos about this issue.


Some more examples (could list much more):

zypper finds in both cases packages for /bin/rm and /usr/bin/rm


lrwxrwxrwx 1 root root      11 20. Nov 18:48 rm -> /usr/bin/rm

which rm
/usr/bin/rm
zypper wp '/usr/bin/rm'
Loading repository data...
Reading installed packages...
S | Name      | Type    | Version    | Arch   | Repository          
--+-----------+---------+------------+--------+---------------------
i | coreutils | package | 8.16-5.8.1 | x86_64 | openSUSE-12.2-Update
v | coreutils | package | 8.16-5.4.1 | x86_64 | openSUSE-12.2-Update
v | coreutils | package | 8.16-5.8.1 | i586   | openSUSE-12.2-Update
v | coreutils | package | 8.16-5.4.1 | i586   | openSUSE-12.2-Update
v | coreutils | package | 8.16-5.1.2 | x86_64 | openSUSE-12.2-Oss   
v | coreutils | package | 8.16-5.1.2 | i586   | openSUSE-12.2-Oss   


zypper wp '/bin/rm'
Loading repository data...
Reading installed packages...
S | Name      | Type    | Version    | Arch   | Repository          
--+-----------+---------+------------+--------+---------------------
i | coreutils | package | 8.16-5.8.1 | x86_64 | openSUSE-12.2-Update
v | coreutils | package | 8.16-5.4.1 | x86_64 | openSUSE-12.2-Update
v | coreutils | package | 8.16-5.8.1 | i586   | openSUSE-12.2-Update
v | coreutils | package | 8.16-5.4.1 | i586   | openSUSE-12.2-Update
v | coreutils | package | 8.16-5.1.2 | x86_64 | openSUSE-12.2-Oss   
v | coreutils | package | 8.16-5.1.2 | i586   | openSUSE-12.2-Oss 

zypper does not find the provides for /usr/bin/mount but for /bin/mount

which mount
/usr/bin/mount

ls -l /bin/mount
lrwxrwxrwx 1 root root 14 16. Nov 19:09 /bin/mount -> /usr/bin/mount
zypper wp '/usr/bin/mount'
Loading repository data...
Reading installed packages...
No providers of '/usr/bin/mount' found.

zypper wp '/bin/mount'
Loading repository data...
Reading installed packages...
S | Name       | Type    | Version      | Arch   | Repository          
--+------------+---------+--------------+--------+---------------------
i | util-linux | package | 2.21.2-4.5.1 | x86_64 | openSUSE-12.2-Update
v | util-linux | package | 2.21.2-4.5.1 | i586   | openSUSE-12.2-Update
v | util-linux | package | 2.21.2-4.2.3 | x86_64 | openSUSE-12.2-Oss   
v | util-linux | package | 2.21.2-4.2.3 | i586   | openSUSE-12.2-Oss 

Package python2.7 is only in /usr/bin and ‘zypper wp’ finds in what package it is.

ls -l /usr/bin/python2.7
-rwxr-xr-x 1 root root 6352 Aug  8 22:07 /usr/bin/python2.7
zypper wp '/usr/bin/python2.7'
Loading repository data...
Reading installed packages...
S | Name        | Type    | Version     | Arch   | Repository       
--+-------------+---------+-------------+--------+------------------
i | python-base | package | 2.7.3-3.6.1 | x86_64 | openSUSE-12.2-Oss
v | python-base | package | 2.7.3-3.6.1 | i586   | openSUSE-12.2-Oss

No one? Any suggestions?

zerum wrote:

>
> No one? Any suggestions?
>
>
The bug is reproducable so you have enough information to file a bug report.

  • zerum wrote, On 01/03/2013 01:36 AM:
    >
    > No one? Any suggestions?

The full path to the file confuses it. Just a “zypper wp mc” works fine.

Uwe

Is long done. No answer yet.

https://bugzilla.novell.com/show_bug.cgi?id=798290

The problem is: it does work sometimes but not in all cases.

Some more examples:

which su
/usr/bin/su

~/ zypper wp su 
Loading repository data...                                                                                                                                                       
Reading installed packages...
No providers of 'su' found.

~/ zypper wp /usr/bin/su
Loading repository data...
Reading installed packages...
No providers of '/usr/bin/su' found.

zypper wp /bin/su
Loading repository data...
Reading installed packages...
S | Name      | Type    | Version     | Arch   | Repository          
--+-----------+---------+-------------+--------+---------------------
i | coreutils | package | 8.16-5.12.1 | x86_64 | openSUSE-12.2-Update
v | coreutils | package | 8.16-5.8.1  | x86_64 | openSUSE-12.2-Update
v | coreutils | package | 8.16-5.4.1  | x86_64 | openSUSE-12.2-Update
v | coreutils | package | 8.16-5.12.1 | i586   | openSUSE-12.2-Update
v | coreutils | package | 8.16-5.8.1  | i586   | openSUSE-12.2-Update
v | coreutils | package | 8.16-5.4.1  | i586   | openSUSE-12.2-Update
v | coreutils | package | 8.16-5.1.2  | x86_64 | openSUSE-12.2-Oss   
v | coreutils | package | 8.16-5.1.2  | i586   | openSUSE-12.2-Oss
~/ zypper wp kfmclient
Loading repository data...
Reading installed packages...
No providers of 'kfmclient' found.

~/ which kfmclient
/usr/bin/kfmclient

~/ zypper wp /usr/bin/kfmclient
Loading repository data...
Reading installed packages...
No providers of '/usr/bin/kfmclient' found.
which mount
/usr/bin/mount

~/ zypper wp mount
Loading repository data...
Reading installed packages...
No providers of 'mount' found.

~/ zypper wp /usr/bin/mount
Loading repository data...
Reading installed packages...
No providers of '/usr/bin/mount' found.

~/ zypper wp /bin/mount
Loading repository data...
Reading installed packages...
S | Name       | Type    | Version      | Arch   | Repository          
--+------------+---------+--------------+--------+---------------------
i | util-linux | package | 2.21.2-4.5.1 | x86_64 | openSUSE-12.2-Update
v | util-linux | package | 2.21.2-4.5.1 | i586   | openSUSE-12.2-Update
v | util-linux | package | 2.21.2-4.2.3 | x86_64 | openSUSE-12.2-Oss   
v | util-linux | package | 2.21.2-4.2.3 | i586   | openSUSE-12.2-Oss

On 2013-02-25 10:56, zerum wrote:
> buckesfeld;2529918 Wrote:
>> > * zerum wrote, On 01/03/2013 01:36 AM:
>>> > >
>>> > > No one? Any suggestions?
>> >
>> > The full path to the file confuses it. Just a “zypper wp mc” works
>> > fine.
> The problem is: it does work sometimes but not in all cases.

Curious…


Cheers / Saludos,

Carlos E. R.
(from 12.1 x86_64 “Asparagus” at Telcontar)

Confirmed. File a bug report, please.

Uwe

On Mon, 25 Feb 2013 09:56:01 GMT, zerum <zerum@no-mx.forums.opensuse.org>
wrote:

>
>buckesfeld;2529918 Wrote:
>> * zerum wrote, On 01/03/2013 01:36 AM:
>> >
>> > No one? Any suggestions?
>>
>> The full path to the file confuses it. Just a “zypper wp mc” works
>> fine.
>
>The problem is: it does work sometimes but not in all cases.
>
>Some more examples:
>
>
>Code:
>--------------------
> which su
> /usr/bin/su
>
> ~/ zypper wp su
> Retrieving repository ‘local’ metadata
> Loading repository data…
> Reading installed packages…
> No providers of ‘su’ found.
>
> ~/ zypper wp /usr/bin/su
> Loading repository data…
> Reading installed packages…
> No providers of ‘/usr/bin/su’ found.
>
> zypper wp /bin/su
> Loading repository data…
> Reading installed packages…
> S | Name | Type | Version | Arch | Repository
> --±----------±--------±------------±-------±--------------------
> i | coreutils | package | 8.16-5.12.1 | x86_64 | openSUSE-12.2-Update
> v | coreutils | package | 8.16-5.8.1 | x86_64 | openSUSE-12.2-Update
> v | coreutils | package | 8.16-5.4.1 | x86_64 | openSUSE-12.2-Update
> v | coreutils | package | 8.16-5.12.1 | i586 | openSUSE-12.2-Update
> v | coreutils | package | 8.16-5.8.1 | i586 | openSUSE-12.2-Update
> v | coreutils | package | 8.16-5.4.1 | i586 | openSUSE-12.2-Update
> v | coreutils | package | 8.16-5.1.2 | x86_64 | openSUSE-12.2-Oss
> v | coreutils | package | 8.16-5.1.2 | i586 | openSUSE-12.2-Oss
>--------------------
>
>
>
>Code:
>--------------------
> ~/ zypper wp kfmclient
> Loading repository data…
> Reading installed packages…
> No providers of ‘kfmclient’ found.
>
> ~/ which kfmclient
> /usr/bin/kfmclient
>
> ~/ zypper wp /usr/bin/kfmclient
> Loading repository data…
> Reading installed packages…
> No providers of ‘/usr/bin/kfmclient’ found.
>--------------------
>
>
>
>Code:
>--------------------
> which mount
> /usr/bin/mount
>
> ~/ zypper wp mount
> Retrieving repository ‘local’ metadata
> Loading repository data…
> Reading installed packages…
> No providers of ‘mount’ found.
>
> ~/ zypper wp /usr/bin/mount
> Loading repository data…
> Reading installed packages…
> No providers of ‘/usr/bin/mount’ found.
>
> ~/ zypper wp /bin/mount
> Loading repository data…
> Reading installed packages…
> S | Name | Type | Version | Arch | Repository
> --±-----------±--------±-------------±-------±--------------------
> i | util-linux | package | 2.21.2-4.5.1 | x86_64 | openSUSE-12.2-Update
> v | util-linux | package | 2.21.2-4.5.1 | i586 | openSUSE-12.2-Update
> v | util-linux | package | 2.21.2-4.2.3 | x86_64 | openSUSE-12.2-Oss
> v | util-linux | package | 2.21.2-4.2.3 | i586 | openSUSE-12.2-Oss
>--------------------

It seems zypper only knows about executables placed in their standard
directories. e.g. on my system:

code:

joseph2k@Godel:~> which su
/bin/su
joseph2k@Godel:~>

joseph2k@Godel:~> which kfmclient
/usr/bin/kfmclient
joseph2k@Godel:~>

joseph2k@Godel:~> which mount
/bin/mount
joseph2k@Godel:~>


HTH

?-)

Bugreport says:

fixed for zypper-1.8.13

https://bugzilla.novell.com/show_bug.cgi?id=798290#c2

Seems that this version is not available yet. Just updated factory and the current version there is 1.8.12.

Now I’ve tried it with zypper 1.8.14 in factory. The devs did some work on it and it works now. The option “what-provides” is now deprecated and is replaced by “search --provides --match-exact”, although it still works with a hint to the new command:

zypper wp /usr/bin/mc
Command 'what-provides' is replaced by 'search --provides --match-exact'.
See 'help search' for all available options.
Loading repository data...
Reading installed packages...

S | Name | Summary            | Type   
--+------+--------------------+--------
  | mc   | Midnight Commander | package

There are also some more options added to ‘search’ command in 1.8.14:

zypper help search
search (se) [options] [querystring] ...

Search for packages matching any of the given search strings.
 Command options:
       ...]
    --provides                  Search for packages which provide the search strings.
    --recommends                Search for packages which recommend the search strings.
    --requires                  Search for packages which require the search strings.
    --suggests                  Search what packages are suggested by the search strings.
    --conflicts                 Search packages conflicting with search strings.
    --obsoletes                 Search for packages which obsolete the search strings.

-n, --name                      Useful together with dependency options, otherwise
                                searching in package name is default.

-f, --file-list                 Search for a match in the file list of packages.

-v, --verbose                   Like --details, with additional information where the
                                search has matched (useful for search in dependencies).

With the release of openSUSE 13.1 we all will take benefit of it.