[Bug 1048837] New: zypper prints inconsistent patch statistics
http://bugzilla.opensuse.org/show_bug.cgi?id=1048837 Bug ID: 1048837 Summary: zypper prints inconsistent patch statistics Classification: openSUSE Product: openSUSE Distribution Version: Leap 42.2 Hardware: Other OS: Other Status: NEW Severity: Normal Priority: P5 - None Component: libzypp Assignee: zypp-maintainers@forge.provo.novell.com Reporter: richard@nod.at QA Contact: qa-bugs@suse.de Found By: --- Blocker: --- On my systems I run the following commands as cron job to get notified when security patches are pending: LANG=C zypper -q --non-interactive ref LANG=C zypper -q --non-interactive lp -g security But sadly the output is not consistent. If no patches at all are available, a blank line is printed. If non-security patches are available it prints "0 patches needed (0 security patches)". This makes matching the output hard and error prone. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1048837
http://bugzilla.opensuse.org/show_bug.cgi?id=1048837#c1
--- Comment #1 from Michael Andres
$ zypper pchk ... Found 163 applicable patches: Category | Updatestack | Patches | Locked ------------+-------------+---------+------- security | - | 99 | 1 recommended | 2 | 58 | 1 optional | - | 2 | -
2 patches locked 2 patches optional 159 patches needed (99 security patches)
EXIT CODES
100 - ZYPPER_EXIT_INF_UPDATE_NEEDED Returned by the patch-check command if there are patches available for installation.
101 - ZYPPER_EXIT_INF_SEC_UPDATE_NEEDED Returned by the patch-check command if there are security patches available for installation.
-- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1048837
http://bugzilla.opensuse.org/show_bug.cgi?id=1048837#c2
--- Comment #2 from Richard Weinberger
You don't need to match the output. You can run e.g. patch-check and test for return code 101:
$ zypper pchk ... Found 163 applicable patches: Category | Updatestack | Patches | Locked ------------+-------------+---------+------- security | - | 99 | 1 recommended | 2 | 58 | 1 optional | - | 2 | -
2 patches locked 2 patches optional 159 patches needed (99 security patches)
EXIT CODES
100 - ZYPPER_EXIT_INF_UPDATE_NEEDED Returned by the patch-check command if there are patches available for installation.
101 - ZYPPER_EXIT_INF_SEC_UPDATE_NEEDED Returned by the patch-check command if there are security patches available for installation.
Oh, that's much better. Thanks! -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1048837
http://bugzilla.opensuse.org/show_bug.cgi?id=1048837#c3
Michael Andres
participants (1)
-
bugzilla_noreply@novell.com