[yast-devel] Install packages by supplements from YCP?
Hi, is it possible to install packages from YCP by using the supplements information? E.g. xfsprogs.spec contains "Supplements: filesystem(xfs)". I want to do something like this: Package::InstallAll(["filesystem(xfs)"]); Regards, Arvin -- Arvin Schnell, <aschnell@suse.de> Senior Software Engineer, Research & Development SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg) -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org For additional commands, e-mail: yast-devel+help@opensuse.org
Arvin Schnell wrote:
Hi,
is it possible to install packages from YCP by using the supplements information?
E.g. xfsprogs.spec contains "Supplements: filesystem(xfs)". I want to do something like this:
Package::InstallAll(["filesystem(xfs)"]);
Unfortunately this does not work. The minor problem is that the rpm check call is not properly escaped: 2009-02-25 14:29:24 <3> muffin(17814) [bash] ShellCommand.cc(shellcommand):78 sh: -c: line 0: syntax error near unexpected token `(' 2009-02-25 14:29:24 <3> muffin(17814) [bash] ShellCommand.cc(shellcommand):78 sh: -c: line 0: `rpm -q --whatprovides filesystem(xfs)' The real problem is that Package::InstallAll() expects list of packages, not supplements. There is Pkg::PkgQueryProvides() call, but it works with "provides" set, "supplements" is something different :-( To support this functionality we would add a new pkg-binding. If you really need it then open a bug report or a FATE entry. -- Best Regards Ladislav Slezák Yast Developer ------------------------------------------------------------------------ SUSE LINUX, s.r.o. e-mail: lslezak@suse.cz Lihovarská 1060/12 tel: +420 284 028 960 190 00 Prague 9 fax: +420 284 028 951 Czech Republic http://www.suse.cz/ -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org For additional commands, e-mail: yast-devel+help@opensuse.org
On Wed, Feb 25, 2009 at 02:42:39PM +0100, Ladislav Slezak wrote:
is it possible to install packages from YCP by using the supplements information?
E.g. xfsprogs.spec contains "Supplements: filesystem(xfs)". I want to do something like this:
Package::InstallAll(["filesystem(xfs)"]);
Unfortunately this does not work.
The minor problem is that the rpm check call is not properly escaped:
2009-02-25 14:29:24 <3> muffin(17814) [bash] ShellCommand.cc(shellcommand):78 sh: -c: line 0: syntax error near unexpected token `(' 2009-02-25 14:29:24 <3> muffin(17814) [bash] ShellCommand.cc(shellcommand):78 sh: -c: line 0: `rpm -q --whatprovides filesystem(xfs)'
Well, missing shell quoting is likely a bug if not a security issue.
The real problem is that Package::InstallAll() expects list of packages, not supplements.
There is Pkg::PkgQueryProvides() call, but it works with "provides" set, "supplements" is something different :-(
To support this functionality we would add a new pkg-binding. If you really need it then open a bug report or a FATE entry.
Thanks, I'll do so. Arvin -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org For additional commands, e-mail: yast-devel+help@opensuse.org
Arvin Schnell wrote:
On Wed, Feb 25, 2009 at 02:42:39PM +0100, Ladislav Slezak wrote:
The minor problem is that the rpm check call is not properly escaped:
2009-02-25 14:29:24 <3> muffin(17814) [bash] ShellCommand.cc(shellcommand):78 sh: -c: line 0: syntax error near unexpected token `(' 2009-02-25 14:29:24 <3> muffin(17814) [bash] ShellCommand.cc(shellcommand):78 sh: -c: line 0: `rpm -q --whatprovides filesystem(xfs)'
Well, missing shell quoting is likely a bug if not a security issue.
Please, report as a bug against SLE 11, this will need a maintenance update. L.
Ladislav Slezak wrote:
is it possible to install packages from YCP by using the supplements information? [...] There is Pkg::PkgQueryProvides() call, but it works with "provides" set, "supplements" is something different :-(
I had another idea, I thought that Pkg::ResolvableDependencies("", `package, "") could be used to manually search for the package which supplements "filesystem(xfs)" capability. This also doesn't work - Pkg::ResolvableDependencies() tries to resolve the dependency - the result contains package names instead of required files (e.g. "prequires: /sbin/ldconfig" is converted to $["dep_kind":"prerequires", "name":"glibc", "res_kind":"package"]) This is nice, but it's completely wrong for "supplements: namespace:filesystem(xfs)" capability, it cannot be resolved to a package, the result map contains empty strings. That's a bug in Pkg::ResolvableDependencies() function. -- Best Regards Ladislav Slezák Yast Developer ------------------------------------------------------------------------ SUSE LINUX, s.r.o. e-mail: lslezak@suse.cz Lihovarská 1060/12 tel: +420 284 028 960 190 00 Prague 9 fax: +420 284 028 951 Czech Republic http://www.suse.cz/ -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org For additional commands, e-mail: yast-devel+help@opensuse.org
Ladislav Slezak wrote:
This is nice, but it's completely wrong for "supplements: namespace:filesystem(xfs)" capability, it cannot be resolved to a package, the result map contains empty strings. That's a bug in Pkg::ResolvableDependencies() function.
JFYI: reported as bnc#479575 -- Best Regards Ladislav Slezák Yast Developer ------------------------------------------------------------------------ SUSE LINUX, s.r.o. e-mail: lslezak@suse.cz Lihovarská 1060/12 tel: +420 284 028 960 190 00 Prague 9 fax: +420 284 028 951 Czech Republic http://www.suse.cz/ -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org For additional commands, e-mail: yast-devel+help@opensuse.org
Ladislav Slezak wrote:
Unfortunately this does not work.
The minor problem is that the rpm check call is not properly escaped:
2009-02-25 14:29:24 <3> muffin(17814) [bash] ShellCommand.cc(shellcommand):78 sh: -c: line 0: syntax error near unexpected token `(' 2009-02-25 14:29:24 <3> muffin(17814) [bash] ShellCommand.cc(shellcommand):78 sh: -c: line 0: `rpm -q --whatprovides filesystem(xfs)'
Why is it using rpm and not ZYpp's WhatProvides? only to avoid initializing the stack? Duncan -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org For additional commands, e-mail: yast-devel+help@opensuse.org
Duncan Mac-Vicar P. wrote:
Why is it using rpm and not ZYpp's WhatProvides? only to avoid initializing the stack?
Yes, it's a quick test which does not need libzypp. If the check fails (the package is not installed) it uses standard way for installation (loads target, refreshes repos...). This has to be very fast because many yast modules check at start up whether the needed packages are installed. And they are usually installed unless the module is started for the first time. -- Best Regards Ladislav Slezák Yast Developer ------------------------------------------------------------------------ SUSE LINUX, s.r.o. e-mail: lslezak@suse.cz Lihovarská 1060/12 tel: +420 284 028 960 190 00 Prague 9 fax: +420 284 028 951 Czech Republic http://www.suse.cz/ -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org For additional commands, e-mail: yast-devel+help@opensuse.org
participants (4)
-
Arvin Schnell
-
Duncan Mac-Vicar P.
-
Ladislav Slezak
-
Lukas Ocilka