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

Merge pull request #900 from htower/master

Skip holded packages
This commit is contained in:
sumpfralle 2018-02-22 00:07:36 +01:00 committed by GitHub
commit f5418e4553
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -116,6 +116,7 @@ if len(sys.argv) > 1:
try: try:
import apt import apt
import apt_pkg
except ImportError: 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" 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) sys.exit(1)
@ -123,7 +124,7 @@ except ImportError:
pkgs = {} pkgs = {}
total = 0 total = 0
for pkg in apt.Cache(): 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) a = check_origin(pkg)
pkgs[a] = pkgs.get(a, 0) + 1 pkgs[a] = pkgs.get(a, 0) + 1
total += 1 total += 1