diff options
author | John Mylchreest <johnm@gentoo.org> | 2005-07-05 13:34:45 +0000 |
---|---|---|
committer | John Mylchreest <johnm@gentoo.org> | 2005-07-05 13:34:45 +0000 |
commit | e47466553011945cfff2cfce34890bfb812847dc (patch) | |
tree | 1037198f44ae7b6549ffe970e9e165420a1150e8 /eclass | |
parent | version bump (diff) | |
download | gentoo-2-e47466553011945cfff2cfce34890bfb812847dc.tar.gz gentoo-2-e47466553011945cfff2cfce34890bfb812847dc.tar.bz2 gentoo-2-e47466553011945cfff2cfce34890bfb812847dc.zip |
oops, missed to commit thjis earlier. Handle moduledb a little tidier
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/linux-mod.eclass | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/eclass/linux-mod.eclass b/eclass/linux-mod.eclass index 3cf587759aee..c2ba38aa776e 100644 --- a/eclass/linux-mod.eclass +++ b/eclass/linux-mod.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/linux-mod.eclass,v 1.40 2005/07/05 11:37:03 johnm Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/linux-mod.eclass,v 1.41 2005/07/05 13:34:45 johnm Exp $ # Description: This eclass is used to interface with linux-info in such a way # to provide the functionality required and initial functions @@ -188,8 +188,20 @@ update_modules() { fi } +move_old_moduledb() { + local OLDDIR=${ROOT}/usr/share/module-rebuild/ + local NEWDIR=${ROOT}/var/lib/module-rebuild/ + + if [[ -f ${OLDDIR}/moduledb ]]; then + [[ ! -d ${NEWDIR} ]] && mkdir -p ${NEWDIR} + mv ${OLDDIR}/moduledb ${NEWDIR}/moduledb + rmdir ${OLDDIR} + fi +} + update_moduledb() { local MODULEDB_DIR=${ROOT}/var/lib/module-rebuild/ + move_old_moduledb if [[ ! -f ${MODULEDB_DIR}/moduledb ]]; then [[ ! -d ${MODULEDB_DIR} ]] && mkdir -p ${MODULEDB_DIR} @@ -203,6 +215,7 @@ update_moduledb() { remove_moduledb() { local MODULEDB_DIR=${ROOT}/var/lib/module-rebuild/ + move_old_moduledb if [[ -n $(grep ${CATEGORY}/${PN}-${PVR} ${MODULEDB_DIR}/moduledb) ]]; then einfo "Removing ${CATEGORY}/${PN}-${PVR} from moduledb." |