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 | 8abf4ac89aaec48ddd3407e5aaf890efacccdd95 (patch) | |
tree | 3177aef97ad6d5e514a153d9fa90e28a9361fe72 /eclass/linux-mod.eclass | |
parent | version bump (diff) | |
download | historical-8abf4ac89aaec48ddd3407e5aaf890efacccdd95.tar.gz historical-8abf4ac89aaec48ddd3407e5aaf890efacccdd95.tar.bz2 historical-8abf4ac89aaec48ddd3407e5aaf890efacccdd95.zip |
oops, missed to commit thjis earlier. Handle moduledb a little tidier
Diffstat (limited to 'eclass/linux-mod.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." |