summaryrefslogtreecommitdiffstats
path: root/pym/_emerge
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2013-01-16 06:11:55 -0800
committerZac Medico <zmedico@gentoo.org>2013-01-16 06:11:55 -0800
commit9a3a82fda113008b877c0447e1d6a8780365ab98 (patch)
tree3ef8681308c787ffdede6393e7b586cf8c5dd7ca /pym/_emerge
parent5978d78f56f0708d3bbbcdb9adc1b96097f3d034 (diff)
downloadportage-9a3a82fda113008b877c0447e1d6a8780365ab98.tar.gz
portage-9a3a82fda113008b877c0447e1d6a8780365ab98.tar.bz2
portage-9a3a82fda113008b877c0447e1d6a8780365ab98.zip
emerge --info: show free ram/swap, bug #451048
Diffstat (limited to 'pym/_emerge')
-rw-r--r--pym/_emerge/actions.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index ac9a60fc0..589680a51 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -25,6 +25,7 @@ portage.proxy.lazyimport.lazyimport(globals(),
'portage.dbapi._similar_name_search:similar_name_search',
'portage.debug',
'portage.news:count_unread_news,display_news_notifications',
+ 'portage.util._get_vm_info:get_vm_info',
'_emerge.chk_updated_cfg_files:chk_updated_cfg_files',
'_emerge.help:help@emerge_help',
'_emerge.post_emerge:display_news_notification,post_emerge',
@@ -1488,6 +1489,18 @@ def action_info(settings, trees, myopts, myfiles):
append(header_width * "=")
append("System uname: %s" % (platform.platform(aliased=1),))
+ vm_info = get_vm_info()
+ if "ram.total" in vm_info:
+ line = "%-9s %10d total" % ("KiB Mem:", vm_info["ram.total"] / 1024)
+ if "ram.free" in vm_info:
+ line += ",%10d free" % (vm_info["ram.free"] / 1024,)
+ append(line)
+ if "swap.total" in vm_info:
+ line = "%-9s %10d total" % ("KiB Swap:", vm_info["swap.total"] / 1024)
+ if "swap.free" in vm_info:
+ line += ",%10d free" % (vm_info["swap.free"] / 1024,)
+ append(line)
+
lastSync = portage.grabfile(os.path.join(
settings["PORTDIR"], "metadata", "timestamp.chk"))
if lastSync: