From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on sa.int.altlinux.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=ham version=3.2.5 Message-ID: <48F48B7A.9020401@altlinux.org> Date: Tue, 14 Oct 2008 16:07:22 +0400 From: "Konstantin A. Lepikhov" User-Agent: Mozilla/5.0 (X11; U; Linux i686; ru; rv:1.9.1b1pre) Gecko/20080917025951 Shredder/3.0b1pre MIME-Version: 1.0 To: ALT Devel discussion list References: <20081014100359.3A44A45D805B@ssh.git.int.altlinux.org> <20081014115559.GB23976@wo.int.altlinux.org> In-Reply-To: <20081014115559.GB23976@wo.int.altlinux.org> Content-Type: text/plain; charset=windows-1251 Content-Transfer-Encoding: 8bit X-Antivirus: Dr.Web (R) for Mail Servers on cavolo.yandex.ru host X-Antivirus-Code: 100000 Subject: Re: [devel] [SCM] packages/kernel-build-tools: heads/master X-BeenThere: devel@lists.altlinux.org X-Mailman-Version: 2.1.10b3 Precedence: list Reply-To: ALT Linux Team development discussions List-Id: ALT Linux Team development discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Oct 2008 12:07:26 -0000 Archived-At: List-Archive: List-Post: 14.10.2008 15:55, Dmitry V. Levin пишет: > On Tue, Oct 14, 2008 at 02:03:59PM +0400, Konstantin A. Lepikhov wrote: > >> Update of /people/lakostis/packages/kernel-build-tools.git >> > [...] > >> new file mode 100755 >> index 0000000..66f7500 >> --- /dev/null >> +++ b/modalias.prov >> @@ -0,0 +1,20 @@ >> +#!/bin/sh -efu >> +# >> +# Copyright (c) 2008 Konstantin Lepikhov . >> +# >> +# This program is free software; you can redistribute it and/or modify >> +# it under the terms of the GNU General Public License as published by >> +# the Free Software Foundation; either version 2 of the License, or >> +# (at your option) any later version. >> + >> +. /usr/lib/rpm/functions >> +. /usr/lib/rpm/find-package >> + >> +ModaliasReq() { >> + local f t >> > > Поскольку тип не проверятеся, t здесь лишний. > > Можно и тип проверить ;) >> + for f in "$@"; do >> + /sbin/modinfo -F alias "$f" |sed -e 's/.*/modalias:&/' -e 's/[,]/?/g' >> + done >> +} >> + >> +ArgvFileAction ModaliasReq "$@" >> diff --git a/modalias.prov.files b/modalias.prov.files >> new file mode 100755 >> index 0000000..b209954 >> --- /dev/null >> +++ b/modalias.prov.files >> @@ -0,0 +1,11 @@ >> +#!/bin/sh -efu >> +buildroot="${RPM_BUILD_ROOT-}" >> + >> +while IFS=$'\t' read -r f t; do >> + case "$f" in >> + "$buildroot"/lib/modules/*/kernel/drivers/*.ko|"$buildroot"/lib/modules/*/kernel/sound/*.ko) >> + [ -z "$f" ] || echo "$f" ;; >> + "$buildroot"/lib/modules/*/*/*.ko) >> + [ -z "$f" ] || echo "$f" ;; >> > > Избыточность: последний case вполне покрывает первые два. > > Тогда вопрос - как это сделать правильно, если нужно проверять каталоги $buildroot"/lib/modules//kernel/drivers/*.ko|"$buildroot"/lib/modules//kernel/sound/*.ko и $buildroot"/lib/modules//<строго один уровень и не kernel>/*.ko