On Thursday 09 February 2012 18:22:10 Michael Schroeder wrote:
On Thu, Feb 09, 2012 at 05:18:11PM +0100, Michael Andres wrote:
2) It should have some impact on 'zypper pchk', which returns the exit codes 0, 100 (ZYPPER_EXIT_INF_UPDATE_NEEDED) or 101 (ZYPPER_EXIT_INF_SEC_UPDATE_NEEDED), if no updates, updates or even security updates are pending.
If 'zypper patch' will omit optional patches, 'zypper pchk' should do the same.
But if optional patches do not count to ZYPPER_EXIT_INF_UPDATE_NEEDED, zypper would return 0 if only optional patches are pending. But 0 should IMO be 'no patches at all'. Thus I'd like to introduce a new return value: ZYPPER_EXIT_INF_OPTIONAL_UPDATES_ONLY
I don't think adding another exit code is necessary. I'd just return 0 if no patch needs to be installed. (I.e. zypper patch does nothing -> zypper pchk returns 0)
Maybe we should also add support for -g to pchk, to make things more consistent. Thus
zypper pchk -g all
would return 101 if there's a needed security update, otherwise 100 if there's a needed recommended or optional update.
+1 In this case I'd also exclude optional patches from 'zypper lp' and show them only in 'zypper lp -g all'. So you get what you see. In presence of optional patches 'lp/patch' can drop an info message: N optional patches are also available. Call 'path -g all' them. Zypper does similar in presence of locked patches. This would give us consistenty among lp/pchk/patch. And without a new return value, we can also expect most scripts using 'pchk' to continue working. -- cu, Michael Andres +------------------------------------------------------------------+ Key fingerprint = 2DFA 5D73 18B1 E7EF A862 27AC 3FB8 9E3A 27C6 B0E4 +------------------------------------------------------------------+ Michael Andres SUSE LINUX Products GmbH, Development, ma@suse.de GF:Jeff Hawn,Jennifer Guild,Felix Imendörffer, HRB16746(AG Nürnberg) Maxfeldstrasse 5, D-90409 Nuernberg, Germany, ++49 (0)911 - 740 53-0 +------------------------------------------------------------------+ -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org To contact the owner, e-mail: zypp-devel+owner@opensuse.org