2
0
mirror of https://github.com/munin-monitoring/contrib.git synced 2018-11-08 00:59:34 +01:00

Skip holded packages

This commit is contained in:
Anton Anikin 2018-02-21 23:06:04 +08:00
parent 1649e36c3d
commit 8ea8a4c81e

View File

@ -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