[zypp-devel] new PoolItem/ResObject call isRelevant()
Hi, this is interesting for all UIs concerning package handling. This call gives an answer to "Is this PoolItem/ResObject interesting for user and should it be shown ?" /** Returns true if the solvable is relevant which means e.G. for patches * that at least one package of the patch is installed. */ bool isRelevant() const; Greetings Stefan -- ******************************************************************************* Stefan Schubert SUSE LINUX GmbH - Maxfeldstrasse 5 - D-90409 Nuernberg, Germany e-mail: schubi@suse.de ------------------------------------------------------------------------------- SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg) -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
Michl has convinced me to add an additional call :-) : /** Check if the solvable is satisfied,broken or not relevant * (not important, so it can be ignored) * \return BROKEN, SATISFIED, NOTRELEVANT */ ValidValue validate() const; So take this call if you need the information if the patch is relevant AND e.g. broken. It is faster :-) Greetings Stefan Stefan Schubert schrieb:
Hi, this is interesting for all UIs concerning package handling. This call gives an answer to "Is this PoolItem/ResObject interesting for user and should it be shown ?"
/** Returns true if the solvable is relevant which means e.G. for patches * that at least one package of the patch is installed. */ bool isRelevant() const;
Greetings Stefan
-- ******************************************************************************* Stefan Schubert SUSE LINUX GmbH - Maxfeldstrasse 5 - D-90409 Nuernberg, Germany e-mail: schubi@suse.de ------------------------------------------------------------------------------- SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg) -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
Hi, I'm just fixing some zypper queries and started to use the following function to print the patch status. Is it right? string string_ppp_status(const PoolItem & pi) { if (pi.isRelevant()) { if (pi.isSatisfied()) return _("Installed"); if (pi.isBroken()) return _("Needed"); // can this ever happen? return ""; } return _("Not Applicable"); } Q: what should isRelevant() return for patterns/products? jano -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
Jan Kupec wrote:
Hi,
I'm just fixing some zypper queries and started to use the following function to print the patch status. Is it right?
string string_ppp_status(const PoolItem & pi) { if (pi.isRelevant()) { if (pi.isSatisfied()) return _("Installed"); if (pi.isBroken()) return _("Needed"); // can this ever happen? return ""; }
return _("Not Applicable"); }
Q: what should isRelevant() return for patterns/products?
jano
I think isBroken has no meaning now, as the patch is never installed, and broken meant installed & !satisfied -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
On Mon, Apr 21, Duncan Mac-Vicar Prett wrote:
Jan Kupec wrote:
Hi,
I'm just fixing some zypper queries and started to use the following function to print the patch status. Is it right?
string string_ppp_status(const PoolItem & pi) { if (pi.isRelevant()) { if (pi.isSatisfied()) return _("Installed");
Should we call it 'installed'? It is not installed and you can't delete it. Call it 'applied'?
if (pi.isBroken()) return _("Needed"); // can this ever happen? return ""; }
return _("Not Applicable"); }
Q: what should isRelevant() return for patterns/products?
jano
I think isBroken has no meaning now, as the patch is never installed, and
I think you think wrong. There are 4 mutual exclusive states: isUndetermined: No validation is performed (for packages). ! isRelevant: Not a single package mentioned by this item is installed. isSatisfied: A relevant items requirements are met. isBroken: A relevant items requirements are broken. -- cu, Michael Andres +------------------------------------------------------------------+ Key fingerprint = 2DFA 5D73 18B1 E7EF A862 27AC 3FB8 9E3A 27C6 B0E4 +------------------------------------------------------------------+ Michael Andres YaST Development ma@novell.com 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@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
Michael Andres wrote:
On Mon, Apr 21, Duncan Mac-Vicar Prett wrote:
Jan Kupec wrote:
Hi,
I'm just fixing some zypper queries and started to use the following function to print the patch status. Is it right?
string string_ppp_status(const PoolItem & pi) { if (pi.isRelevant()) { if (pi.isSatisfied()) return _("Installed");
Should we call it 'installed'? It is not installed and you can't delete it. Call it 'applied'?
if (pi.isBroken()) return _("Needed"); // can this ever happen? return ""; }
return _("Not Applicable"); }
Q: what should isRelevant() return for patterns/products?
jano
I think isBroken has no meaning now, as the patch is never installed, and
I think you think wrong.
There are 4 mutual exclusive states:
isUndetermined: No validation is performed (for packages).
! isRelevant: Not a single package mentioned by this item is installed.
isSatisfied: A relevant items requirements are met.
isBroken: A relevant items requirements are broken.
Makes sense. One more question: how does this apply to Patterns and Products? I guess isRelevant is not relevant here :O) So is isBroken. The only that we care for the product or patterns is isSatisified()? jano -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
On Mon, Apr 28, Jan Kupec wrote:
Makes sense. One more question: how does this apply to Patterns and Products? I guess isRelevant is not relevant here :O) So is isBroken. The only that we care for the product or patterns is isSatisified()?
Yes, isSatisified is sort of 'installed'. Everything else is more or less inclomplete. -- cu, Michael Andres +------------------------------------------------------------------+ Key fingerprint = 2DFA 5D73 18B1 E7EF A862 27AC 3FB8 9E3A 27C6 B0E4 +------------------------------------------------------------------+ Michael Andres YaST Development ma@novell.com 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@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
participants (4)
-
Duncan Mac-Vicar Prett
-
Jan Kupec
-
Michael Andres
-
Stefan Schubert