Mailinglist Archive: zypp-devel (18 mails)

< Previous Next >
Re: [zypp-devel] [libzpp] How to mark a installed package as uninstalled?
On Friday 01 April 2011 11:22:25 Yi Yang wrote:
Hi,

We used libzypp-binding in MeeGo image creator, once one package is marked
as installed by item.status().setToBeInstalled (zypp.ResStatus.USER), it
can't be re-marked as uninstalled by
item.status().setToBeUninstalled(zypp.ResStatus.USER), this is necessary if
we don't want to install a package in a pattern, anybody knows there is a
know way to do this? Thanks in advance.

setToBeInstalled: request to install a not yet installed package
setToBeUninstalled: request to delete an already installed package

To simply keep the package as it currently is (installed or not) you have
basically 2 options:

- setTransact(false, zypp.ResStatus.USER)
- resetTransact(zypp.ResStatus.USER)

Both will reset the status so there is no solver request created for this
item. There is a slight - but sometimes important - difference in both calls:

- setTransact(..) flags the status a 'set by USER'.
The solver will NOT re-select this package in case it is just recommended by
some other package to be installed. Only if the package is required, the
solver will re-select it to prevent a dependency error.
(If you want to prevent this from being selected even if it was required, you
need to lock the item.)

- resetTransact(..) clears all flags
The solver is free to re-select this package even if it is just recommended by
some other package.

--

cu,
Michael Andres

+------------------------------------------------------------------+
Key fingerprint = 2DFA 5D73 18B1 E7EF A862 27AC 3FB8 9E3A 27C6 B0E4
+------------------------------------------------------------------+
Michael Andres ZYPP Development ma@xxxxxxx
SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nuernberg)
Maxfeldstrasse 5, D-90409 Nuernberg, Germany, ++49 (0)911 - 740 53-0
+------------------------------------------------------------------+

--
To unsubscribe, e-mail: zypp-devel+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: zypp-devel+help@xxxxxxxxxxxx

< Previous Next >
List Navigation
This Thread
References