From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <gentoo-commits+bounces-898698-garchives=archives.gentoo.org@lists.gentoo.org> Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 7F3E8138330 for <garchives@archives.gentoo.org>; Thu, 25 Aug 2016 21:22:16 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 307BBE0A40; Thu, 25 Aug 2016 21:22:13 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id CBDA3E0A40 for <gentoo-commits@lists.gentoo.org>; Thu, 25 Aug 2016 21:22:12 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 6D8263407E6 for <gentoo-commits@lists.gentoo.org>; Thu, 25 Aug 2016 21:22:11 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id B0BB7245B for <gentoo-commits@lists.gentoo.org>; Thu, 25 Aug 2016 21:22:09 +0000 (UTC) From: "William Hubbs" <williamh@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, "William Hubbs" <williamh@gentoo.org> Message-ID: <1472159553.fef6268f8d03e3ab3e2564cbf3634d0db2bcd99e.williamh@OpenRC> Subject: [gentoo-commits] proj/openrc:master commit in: init.d/ X-VCS-Repository: proj/openrc X-VCS-Files: init.d/modules-load.in X-VCS-Directories: init.d/ X-VCS-Committer: williamh X-VCS-Committer-Name: William Hubbs X-VCS-Revision: fef6268f8d03e3ab3e2564cbf3634d0db2bcd99e X-VCS-Branch: master Date: Thu, 25 Aug 2016 21:22:09 +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: 798d8f52-5135-47ed-8b25-ece8b564ce14 X-Archives-Hash: 54c37d3d4b43fce68a0153ac4b857b5e commit: fef6268f8d03e3ab3e2564cbf3634d0db2bcd99e Author: William Hubbs <w.d.hubbs <AT> gmail <DOT> com> AuthorDate: Thu Aug 25 21:10:45 2016 +0000 Commit: William Hubbs <williamh <AT> gentoo <DOT> org> CommitDate: Thu Aug 25 21:12:33 2016 +0000 URL: https://gitweb.gentoo.org/proj/openrc.git/commit/?id=fef6268f modules-load.d: cleanups Move list of directories to a local variable and create the fn variable to use for an individual file name rather than using path. init.d/modules-load.in | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/init.d/modules-load.in b/init.d/modules-load.in index 8c19a36..0f80396 100644 --- a/init.d/modules-load.in +++ b/init.d/modules-load.in @@ -16,12 +16,11 @@ depend() keyword -docker -lxc -openvz -prefix -systemd-nspawn -vserver } -modules_dirs="/usr/lib/modules-load.d /run/modules-load.d /etc/modules-load.d" - find_modfiles() { - local basenames files x y - for x in $modules_dirs; do + local dirs="/usr/lib/modules-load.d /run/modules-load.d /etc/modules-load.d" + local basenames files fn x y + for x in $dirs; do [ ! -d $x ] && continue for y in $x/*.conf; do [ -f $y ] && basenames="${basenames}\n${y##*/}" @@ -29,11 +28,11 @@ find_modfiles() done basenames=$(printf "$basenames" | sort -u) for x in $basenames; do - for y in $modules_dirs; do + for y in $dirs; do [ -r $y/$x ] && - path=$y/$x + fn=$y/$x done - files="$files $path" + files="$files $fn" done echo $files }