mirror of
https://github.com/munin-monitoring/contrib.git
synced 2018-11-08 00:59:34 +01:00
commit
f5418e4553
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user