From 8ea8a4c81e0b16f1eab55e2f9085bf27f01c5f62 Mon Sep 17 00:00:00 2001 From: Anton Anikin Date: Wed, 21 Feb 2018 23:06:04 +0800 Subject: [PATCH] Skip holded packages --- plugins/ubuntu/apt_ubuntu | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/ubuntu/apt_ubuntu b/plugins/ubuntu/apt_ubuntu index a54e1008..d13654a3 100755 --- a/plugins/ubuntu/apt_ubuntu +++ b/plugins/ubuntu/apt_ubuntu @@ -116,6 +116,7 @@ if len(sys.argv) > 1: try: import apt + import apt_pkg except ImportError: print "The module 'apt' is currently not installed. You can install it by typing:\nsudo apt-get install python-apt\nImportError: No module named apt" sys.exit(1) @@ -123,7 +124,7 @@ except ImportError: pkgs = {} total = 0 for pkg in apt.Cache(): - if pkg.is_upgradable: + if (pkg.is_upgradable) and (pkg._pkg.selected_state != apt_pkg.SELSTATE_HOLD): a = check_origin(pkg) pkgs[a] = pkgs.get(a, 0) + 1 total += 1