/[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.70 Revision 1.74
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.70 2007/01/01 22:27:01 swegener Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/linux-mod.eclass,v 1.74 2007/04/16 19:20:28 vapier 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.
181} 181}
182 182
183update_modules() { 183update_modules() {
184 debug-print-function ${FUNCNAME} $* 184 debug-print-function ${FUNCNAME} $*
185 185
186 if [ -x /sbin/modules-update ] && \ 186 if [ -x /sbin/update-modules ] && \
187 grep -v -e "^#" -e "^$" ${D}/etc/modules.d/* >/dev/null 2>&1; then 187 grep -v -e "^#" -e "^$" ${D}/etc/modules.d/* >/dev/null 2>&1; then
188 ebegin "Updating modules.conf" 188 ebegin "Updating modules.conf"
189 /sbin/modules-update 189 /sbin/update-modules
190 eend $?
191 elif [ -x /sbin/update-modules ] && \
192 grep -v -e "^#" -e "^$" ${D}/etc/modules.d/* >/dev/null 2>&1; then
193 ebegin "Updating modules.conf"
194 /sbin/update-modules
190 eend $? 195 eend $?
191 fi 196 fi
192} 197}
193 198
194move_old_moduledb() { 199move_old_moduledb() {
214 219
215 if [[ ! -f ${MODULEDB_DIR}/moduledb ]]; then 220 if [[ ! -f ${MODULEDB_DIR}/moduledb ]]; then
216 [[ ! -d ${MODULEDB_DIR} ]] && mkdir -p ${MODULEDB_DIR} 221 [[ ! -d ${MODULEDB_DIR} ]] && mkdir -p ${MODULEDB_DIR}
217 touch ${MODULEDB_DIR}/moduledb 222 touch ${MODULEDB_DIR}/moduledb
218 fi 223 fi
224
219 if [[ -z $(grep ${CATEGORY}/${PN}-${PVR} ${MODULEDB_DIR}/moduledb) ]]; then 225 if ! grep -qs ${CATEGORY}/${PN}-${PVR} ${MODULEDB_DIR}/moduledb ; then
220 einfo "Adding module to moduledb." 226 einfo "Adding module to moduledb."
221 echo "a:1:${CATEGORY}/${PN}-${PVR}" >> ${MODULEDB_DIR}/moduledb 227 echo "a:1:${CATEGORY}/${PN}-${PVR}" >> ${MODULEDB_DIR}/moduledb
222 fi 228 fi
223} 229}
224 230
226 debug-print-function ${FUNCNAME} $* 232 debug-print-function ${FUNCNAME} $*
227 233
228 local MODULEDB_DIR=${ROOT}/var/lib/module-rebuild/ 234 local MODULEDB_DIR=${ROOT}/var/lib/module-rebuild/
229 move_old_moduledb 235 move_old_moduledb
230 236
231 if [[ -n $(grep ${CATEGORY}/${PN}-${PVR} ${MODULEDB_DIR}/moduledb) ]]; then 237 if grep -qs ${CATEGORY}/${PN}-${PVR} ${MODULEDB_DIR}/moduledb ; then
232 einfo "Removing ${CATEGORY}/${PN}-${PVR} from moduledb." 238 einfo "Removing ${CATEGORY}/${PN}-${PVR} from moduledb."
233 sed -ie "/.*${CATEGORY}\/${PN}-${PVR}.*/d" ${MODULEDB_DIR}/moduledb 239 sed -i -e "/.*${CATEGORY}\/${PN}-${PVR}.*/d" ${MODULEDB_DIR}/moduledb
234 fi 240 fi
235} 241}
236 242
237set_kvobj() { 243set_kvobj() {
238 debug-print-function ${FUNCNAME} $* 244 debug-print-function ${FUNCNAME} $*

Legend:
Removed from v.1.70  
changed lines
  Added in v.1.74

  ViewVC Help
Powered by ViewVC 1.1.20