/[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.40 Revision 1.41
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.40 2005/07/05 11:37:03 johnm Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/linux-mod.eclass,v 1.41 2005/07/05 13:34:45 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.
186 /sbin/modules-update 186 /sbin/modules-update
187 eend $? 187 eend $?
188 fi 188 fi
189} 189}
190 190
191move_old_moduledb() {
192 local OLDDIR=${ROOT}/usr/share/module-rebuild/
193 local NEWDIR=${ROOT}/var/lib/module-rebuild/
194
195 if [[ -f ${OLDDIR}/moduledb ]]; then
196 [[ ! -d ${NEWDIR} ]] && mkdir -p ${NEWDIR}
197 mv ${OLDDIR}/moduledb ${NEWDIR}/moduledb
198 rmdir ${OLDDIR}
199 fi
200}
201
191update_moduledb() { 202update_moduledb() {
192 local MODULEDB_DIR=${ROOT}/var/lib/module-rebuild/ 203 local MODULEDB_DIR=${ROOT}/var/lib/module-rebuild/
204 move_old_moduledb
193 205
194 if [[ ! -f ${MODULEDB_DIR}/moduledb ]]; then 206 if [[ ! -f ${MODULEDB_DIR}/moduledb ]]; then
195 [[ ! -d ${MODULEDB_DIR} ]] && mkdir -p ${MODULEDB_DIR} 207 [[ ! -d ${MODULEDB_DIR} ]] && mkdir -p ${MODULEDB_DIR}
196 touch ${MODULEDB_DIR}/moduledb 208 touch ${MODULEDB_DIR}/moduledb
197 fi 209 fi
201 fi 213 fi
202} 214}
203 215
204remove_moduledb() { 216remove_moduledb() {
205 local MODULEDB_DIR=${ROOT}/var/lib/module-rebuild/ 217 local MODULEDB_DIR=${ROOT}/var/lib/module-rebuild/
218 move_old_moduledb
206 219
207 if [[ -n $(grep ${CATEGORY}/${PN}-${PVR} ${MODULEDB_DIR}/moduledb) ]]; then 220 if [[ -n $(grep ${CATEGORY}/${PN}-${PVR} ${MODULEDB_DIR}/moduledb) ]]; then
208 einfo "Removing ${CATEGORY}/${PN}-${PVR} from moduledb." 221 einfo "Removing ${CATEGORY}/${PN}-${PVR} from moduledb."
209 sed -ie "/.*${CATEGORY}\/${P}.*/d" ${MODULEDB_DIR}/moduledb 222 sed -ie "/.*${CATEGORY}\/${P}.*/d" ${MODULEDB_DIR}/moduledb
210 fi 223 fi

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

  ViewVC Help
Powered by ViewVC 1.1.20