summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2007-03-01 06:40:28 +0000
committerMike Frysinger <vapier@gentoo.org>2007-03-01 06:40:28 +0000
commit0ec1b4202b3c4cd0913daa0cd13f5faa7dc1c78e (patch)
tree77e9be8e6230ba4bca70edcf975540928193eec3 /eclass/linux-mod.eclass
parentFix another libdir snafu. (diff)
downloadgentoo-2-0ec1b4202b3c4cd0913daa0cd13f5faa7dc1c78e.tar.gz
gentoo-2-0ec1b4202b3c4cd0913daa0cd13f5faa7dc1c78e.tar.bz2
gentoo-2-0ec1b4202b3c4cd0913daa0cd13f5faa7dc1c78e.zip
tweak grepping of moduledb to avoid errors when moduledb hasnt actually been installed
Diffstat (limited to 'eclass/linux-mod.eclass')
-rw-r--r--eclass/linux-mod.eclass7
1 files changed, 4 insertions, 3 deletions
diff --git a/eclass/linux-mod.eclass b/eclass/linux-mod.eclass
index 952e50001c1e..3659f06a9826 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.71 2007/02/05 14:51:07 dsd Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/linux-mod.eclass,v 1.72 2007/03/01 06:40:28 vapier Exp $
# Description: This eclass is used to interface with linux-info in such a way
# to provide the functionality required and initial functions
@@ -216,7 +216,8 @@ update_moduledb() {
[[ ! -d ${MODULEDB_DIR} ]] && mkdir -p ${MODULEDB_DIR}
touch ${MODULEDB_DIR}/moduledb
fi
- if [[ -z $(grep ${CATEGORY}/${PN}-${PVR} ${MODULEDB_DIR}/moduledb) ]]; then
+
+ if ! grep -qs ${CATEGORY}/${PN}-${PVR} ${MODULEDB_DIR}/moduledb ; then
einfo "Adding module to moduledb."
echo "a:1:${CATEGORY}/${PN}-${PVR}" >> ${MODULEDB_DIR}/moduledb
fi
@@ -228,7 +229,7 @@ remove_moduledb() {
local MODULEDB_DIR=${ROOT}/var/lib/module-rebuild/
move_old_moduledb
- if [[ -n $(grep ${CATEGORY}/${PN}-${PVR} ${MODULEDB_DIR}/moduledb) ]]; then
+ if grep -qs ${CATEGORY}/${PN}-${PVR} ${MODULEDB_DIR}/moduledb ; then
einfo "Removing ${CATEGORY}/${PN}-${PVR} from moduledb."
sed -i -e "/.*${CATEGORY}\/${PN}-${PVR}.*/d" ${MODULEDB_DIR}/moduledb
fi