Blob Blame History Raw
--- usr/lib/byobu/updates_available.old	2011-07-24 12:47:09.348399496 +0200
+++ usr/lib/byobu/updates_available	2011-07-24 13:04:49.087807911 +0200
@@ -44,7 +44,11 @@
 	# These are very computationally intensive processes.
 	# Background this work, have it write to the cache files,
 	# and let the next cache check pick up the results.
-	if [ -x /usr/lib/update-notifier/apt-check ]; then
+    # packagekit should be available almost everywhere nowadays
+    if command -v pkcon >/dev/null; then
+        # use packagekit to show list of packages
+		pkcon get-updates -p | grep -E '^Package' | wc -l > "$mycache" &
+	elif [ -x /usr/lib/update-notifier/apt-check ]; then
 		# If apt-check binary exists, use it
 		/usr/lib/update-notifier/apt-check 2>&1 | awk '-F;' 'END { print $1, $2 }' > "$mycache" &
 	elif command -v apt-get >/dev/null; then
@@ -69,6 +73,10 @@
 	mycache=$1
 	# The cache doesn't exist: create it
 	[ ! -e "$mycache" ] && return 0
+    # packagekit support
+    if -e /var/lib/PackageKit/transactions.db; then
+		[ "/var/lib/PackageKit/transactions.db" -nt "$mycache" ] && return 0
+	fi
 	if command -v apt-get >/dev/null; then
 		# Debian/ubuntu
 		[ "/var/lib/apt" -nt "$mycache" ] || [ "/var/lib/apt/lists" -nt "$mycache" ]
@@ -83,8 +91,13 @@
 	return 1
 }
 
+# show name of available update packages
+
 __updates_available_detail() {
-	if command -v apt-get >/dev/null; then
+	if command pkcon >/dev/null; then
+		detail=`pkcon get-updates -p | grep -E '^Package'`
+        printf "$detail"
+	elif command -v apt-get >/dev/null; then
 		detail=`apt-get -s -o Debug::NoLocking=true upgrade`
 		if [ "$1" = "--detail" ]; then
 			printf "$detail"