Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 576460 Details for
Bug 569966
check-reqs.eclass: please allow to optionally use swap for memory checks
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
check-reqs.eclass.patch (text/plain), 2.27 KB, created by
Arfrever Frehtes Taifersar Arahesis
on 2019-05-13 14:36:12 UTC
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Arfrever Frehtes Taifersar Arahesis
Created:
2019-05-13 14:36:12 UTC
Size:
2.27 KB
patch
obsolete
>From 45e4dc2b74647e8e7a53af07e0a4e1ba53d3355b Mon Sep 17 00:00:00 2001 >From: Arfrever Frehtes Taifersar Arahesis <Arfrever@Apache.Org> >Date: Mon, 13 May 2019 16:30:15 +0200 >Subject: [PATCH] check-reqs.eclass: check-reqs_memory(): Check for available > swap. > >Print warning if usage of swap appears to be needed. > >Fixes: https://bugs.gentoo.org/569966 >Signed-off-by: Arfrever Frehtes Taifersar Arahesis <Arfrever@Apache.Org> >--- > eclass/check-reqs.eclass | 21 +++++++++++++++------ > 1 file changed, 15 insertions(+), 6 deletions(-) > >diff --git a/eclass/check-reqs.eclass b/eclass/check-reqs.eclass >index 689944c8770..eff831ed7e6 100644 >--- a/eclass/check-reqs.eclass >+++ b/eclass/check-reqs.eclass >@@ -1,4 +1,4 @@ >-# Copyright 1999-2018 Gentoo Foundation >+# Copyright 2004-2019 Gentoo Authors > # Distributed under the terms of the GNU General Public License v2 > > # @ECLASS: check-reqs.eclass >@@ -245,6 +245,7 @@ check-reqs_memory() { > > local size=${1} > local actual_memory >+ local actual_swap > > check-reqs_start_phase \ > ${size} \ >@@ -252,19 +253,27 @@ check-reqs_memory() { > > if [[ -r /proc/meminfo ]] ; then > actual_memory=$(awk '/MemTotal/ { print $2 }' /proc/meminfo) >+ actual_swap=$(awk '/SwapTotal/ { print $2 }' /proc/meminfo) > else >- actual_memory=$(sysctl hw.physmem 2>/dev/null ) >+ actual_memory=$(sysctl hw.physmem 2>/dev/null) > [[ "$?" == "0" ]] && >- actual_memory=$(echo $actual_memory | sed -e 's/^[^:=]*[:=]//' ) >+ actual_memory=$(echo "${actual_memory}" | sed -e 's/^[^:=]*[:=][[:space:]]*//') >+ actual_swap=$(sysctl vm.swap_total 2>/dev/null) >+ [[ "$?" == "0" ]] && >+ actual_swap=$(echo "${actual_swap}" | sed -e 's/^[^:=]*[:=][[:space:]]*//') > fi > if [[ -n ${actual_memory} ]] ; then >- if [[ ${actual_memory} -lt $(check-reqs_get_kibibytes ${size}) ]] ; then >+ if [[ ${actual_memory} -ge $(check-reqs_get_kibibytes ${size}) ]] ; then >+ eend 0 >+ elif [[ -n ${actual_swap} && $((${actual_memory} + ${actual_swap})) -ge $(check-reqs_get_kibibytes ${size}) ]] ; then >+ ewarn "Amount of actual memory is insufficient, but amount of actual memory combined with swap is sufficient." >+ ewarn "Build process may make computer very slow!" >+ eend 0 >+ else > eend 1 > check-reqs_unsatisfied \ > ${size} \ > "RAM" >- else >- eend 0 > fi > else > eend 1 >-- >2.21.0 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 569966
: 576460