/[gentoo-x86]/eclass/linux-mod.eclass
Gentoo

Diff of /eclass/linux-mod.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.39 Revision 1.40
1# Copyright 1999-2004 Gentoo Foundation 1# Copyright 1999-2004 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2 2# Distributed under the terms of the GNU General Public License v2
3# $Header: /var/cvsroot/gentoo-x86/eclass/linux-mod.eclass,v 1.39 2005/06/30 08:58:55 brix Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/linux-mod.eclass,v 1.40 2005/07/05 11:37:03 johnm Exp $
4 4
5# Description: This eclass is used to interface with linux-info in such a way 5# Description: This eclass is used to interface with linux-info in such a way
6# to provide the functionality required and initial functions 6# to provide the functionality required and initial functions
7# required to install external modules against a kernel source 7# required to install external modules against a kernel source
8# tree. 8# tree.
187 eend $? 187 eend $?
188 fi 188 fi
189} 189}
190 190
191update_moduledb() { 191update_moduledb() {
192 if [[ ! -f ${ROOT}/usr/share/module-rebuild/moduledb ]]; then 192 local MODULEDB_DIR=${ROOT}/var/lib/module-rebuild/
193 [[ ! -d ${ROOT}/usr/share/module-rebuild/ ]] && mkdir ${ROOT}/usr/share/module-rebuild/ 193
194 touch ${ROOT}/usr/share/module-rebuild/moduledb 194 if [[ ! -f ${MODULEDB_DIR}/moduledb ]]; then
195 [[ ! -d ${MODULEDB_DIR} ]] && mkdir -p ${MODULEDB_DIR}
196 touch ${MODULEDB_DIR}/moduledb
195 fi 197 fi
196 if [[ -z $(grep ${CATEGORY}/${PN}-${PVR} ${ROOT}/usr/share/module-rebuild/moduledb) ]]; then 198 if [[ -z $(grep ${CATEGORY}/${PN}-${PVR} ${MODULEDB_DIR}/moduledb) ]]; then
197 einfo "Adding module to moduledb." 199 einfo "Adding module to moduledb."
198 echo "a:1:${CATEGORY}/${PN}-${PVR}" >> ${ROOT}/usr/share/module-rebuild/moduledb 200 echo "a:1:${CATEGORY}/${PN}-${PVR}" >> ${MODULEDB_DIR}/moduledb
199 fi 201 fi
200} 202}
201 203
202remove_moduledb() { 204remove_moduledb() {
205 local MODULEDB_DIR=${ROOT}/var/lib/module-rebuild/
206
203 if [[ -n $(grep ${CATEGORY}/${PN}-${PVR} ${ROOT}/usr/share/module-rebuild/moduledb) ]]; then 207 if [[ -n $(grep ${CATEGORY}/${PN}-${PVR} ${MODULEDB_DIR}/moduledb) ]]; then
204 einfo "Removing ${CATEGORY}/${PN}-${PVR} from moduledb." 208 einfo "Removing ${CATEGORY}/${PN}-${PVR} from moduledb."
205 sed -ie "/.*${CATEGORY}\/${P}.*/d" ${ROOT}/usr/share/module-rebuild/moduledb 209 sed -ie "/.*${CATEGORY}\/${P}.*/d" ${MODULEDB_DIR}/moduledb
206 fi 210 fi
207} 211}
208 212
209set_kvobj() { 213set_kvobj() {
210 if kernel_is 2 6 214 if kernel_is 2 6

Legend:
Removed from v.1.39  
changed lines
  Added in v.1.40

  ViewVC Help
Powered by ViewVC 1.1.20