From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <gentoo-commits+bounces-711769-garchives=archives.gentoo.org@lists.gentoo.org> Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 5E32D13877A for <garchives@archives.gentoo.org>; Thu, 17 Jul 2014 17:56:50 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 09D61E0814; Thu, 17 Jul 2014 17:56:47 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 860E4E0814 for <gentoo-commits@lists.gentoo.org>; Thu, 17 Jul 2014 17:56:46 +0000 (UTC) Received: from spoonbill.gentoo.org (spoonbill.gentoo.org [81.93.255.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 730A833ECA5 for <gentoo-commits@lists.gentoo.org>; Thu, 17 Jul 2014 17:56:45 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by spoonbill.gentoo.org (Postfix) with ESMTP id 1B1D21807D for <gentoo-commits@lists.gentoo.org>; Thu, 17 Jul 2014 17:56:44 +0000 (UTC) From: "Robin H. Johnson" <robbat2@gentoo.org> To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Robin H. Johnson" <robbat2@gentoo.org> Message-ID: <1405538199.e9212e5164877056cb44bd1be542f0ab8c1c0f1a.robbat2@OpenRC> Subject: [gentoo-commits] proj/netifrc:master commit in: init.d/ X-VCS-Repository: proj/netifrc X-VCS-Files: init.d/net.lo.in X-VCS-Directories: init.d/ X-VCS-Committer: robbat2 X-VCS-Committer-Name: Robin H. Johnson X-VCS-Revision: e9212e5164877056cb44bd1be542f0ab8c1c0f1a X-VCS-Branch: master Date: Thu, 17 Jul 2014 17:56:44 +0000 (UTC) Precedence: bulk List-Post: <mailto:gentoo-commits@lists.gentoo.org> List-Help: <mailto:gentoo-commits+help@lists.gentoo.org> List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org> List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org> List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org> X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: a461573e-f75c-4071-ba8a-475535aa4d6b X-Archives-Hash: bf23984c2a5f39fa63bd01f134b6493b commit: e9212e5164877056cb44bd1be542f0ab8c1c0f1a Author: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org> AuthorDate: Wed Jul 16 19:07:56 2014 +0000 Commit: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org> CommitDate: Wed Jul 16 19:16:39 2014 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/netifrc.git;a=commit;h=e9212e51 net.lo: cached module list timing issue Handle cached modulelist being newer than current time, as it would not be recached even when needed; force recache. Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org> X-Gentoo-Bug: 506966 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=506966 --- init.d/net.lo.in | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/init.d/net.lo.in b/init.d/net.lo.in index 5ea73c7..01c1b20 100644 --- a/init.d/net.lo.in +++ b/init.d/net.lo.in @@ -218,16 +218,20 @@ _show_address() _gen_module_list() { local x= f= force=$1 - if ! ${force} && [ -s "${MODULESLIST}" -a "${MODULESLIST}" -nt "${MODULESDIR}" ]; then - local update=false - for x in "${MODULESDIR}"/*.sh; do - [ -e "${x}" ] || continue - if [ "${x}" -nt "${MODULESLIST}" ]; then - update=true - break - fi - done - ${update} || return 0 + if ! ${force} ; then + if [ -s "${MODULESLIST}" -a "${MODULESLIST}" -nt /proc/$$/status ]; then + ewarn "Discarding cached module list ($MODULESLIST) as it's newer current time!" + elif [ -s "${MODULESLIST}" -a "${MODULESLIST}" -nt "${MODULESDIR}" ]; then + local update=false + for x in "${MODULESDIR}"/*.sh; do + [ -e "${x}" ] || continue + if [ "${x}" -nt "${MODULESLIST}" ]; then + update=true + break + fi + done + ${update} || return 0 + fi fi einfo "Caching network module dependencies"