Merge lp:~sanjay-ankur/byobu/byobu into lp:byobu

Proposed by Ankur Sinha
Status: Needs review
Proposed branch: lp:~sanjay-ankur/byobu/byobu
Merge into: lp:byobu
Diff against target: 23 lines (+6/-0)
1 file modified
usr/lib/byobu/updates_available (+6/-0)
To merge this branch: bzr merge lp:~sanjay-ankur/byobu/byobu
Reviewer Review Type Date Requested Status
Dustin Kirkland  Approve
Review via email: mp+415959@code.launchpad.net
To post a comment you must log in.
lp:~sanjay-ankur/byobu/byobu updated
2645. By Ankur Sinha

feat(updates): check dnf cache update time

Revision history for this message
Dustin Kirkland  (kirkland) wrote :
review: Approve

Unmerged revisions

2645. By Ankur Sinha

feat(updates): check dnf cache update time

2644. By Ankur Sinha

feat(updates): add dnf

Note that using `dnf updateinfo` is probably a better way because it also
provides information on the nature of the updates---security, bugfix, and so
on. However, currently, it seems to ignore all non Fedora repositories, so the
total numbers are wrong.A bug has been filed for this, and depending on how
that goes, this `dnf` command can be tweaked in the future:

https://bugzilla.redhat.com/show_bug.cgi?id=2057096

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'usr/lib/byobu/updates_available'
2--- usr/lib/byobu/updates_available 2019-05-26 19:15:34 +0000
3+++ usr/lib/byobu/updates_available 2022-03-14 10:11:43 +0000
4@@ -54,6 +54,9 @@
5 elif eval $BYOBU_TEST apt-get >/dev/null; then
6 # If apt-get exists, use it
7 flock -xn "$flock" apt-get -s -o Debug::NoLocking=true upgrade | grep -c ^Inst >$mycache 2>/dev/null &
8+ elif eval $BYOBU_TEST dnf >/dev/null; then
9+ # If dnf exists, use it
10+ flock -xn "$flock" dnf list --upgrades -q -y | grep -vc "Available Upgrades" >$mycache 2>/dev/null &
11 elif eval $BYOBU_TEST pkcon >/dev/null; then
12 # use packagekit to show list of packages
13 LC_ALL=C flock -xn "$flock" pkcon get-updates -p | awk '/^Results:$/ { start=NR }; /^Security/ { security++ }; END { if (!/There are no updates available at this time./) { print NR-start, security }}' > "$mycache" 2>/dev/null &
14@@ -103,6 +106,9 @@
15 else
16 return 1
17 fi
18+ elif [ -e "/var/cache/dnf/packages.db" ]; then
19+ [ "/var/cache/dnf/packages.db" -nt "$mycache" ]
20+ return $?
21 elif [ -e "/var/lib/PackageKit/transactions.db" ]; then
22 [ "/var/lib/PackageKit/transactions.db" -nt "$mycache" ]
23 return $?

Subscribers

People subscribed via source and target branches