From: "Robin H. Johnson (robbat2)" <robbat2@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] gentoo-x86 commit in eclass: linux-mod.eclass
Date: Sun, 10 Jan 2010 09:38:50 +0000 [thread overview]
Message-ID: <E1NTuG2-0004ob-UY@stork.gentoo.org> (raw)
robbat2 10/01/10 09:38:50
Modified: linux-mod.eclass
Log:
Bug #258209: Fix quoting of directories.
Revision Changes Path
1.96 eclass/linux-mod.eclass
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/linux-mod.eclass?rev=1.96&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/linux-mod.eclass?rev=1.96&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/linux-mod.eclass?r1=1.95&r2=1.96
Index: linux-mod.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/linux-mod.eclass,v
retrieving revision 1.95
retrieving revision 1.96
diff -p -w -b -B -u -u -r1.95 -r1.96
--- linux-mod.eclass 6 Sep 2009 23:16:37 -0000 1.95
+++ linux-mod.eclass 10 Jan 2010 09:38:50 -0000 1.96
@@ -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.95 2009/09/06 23:16:37 robbat2 Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/linux-mod.eclass,v 1.96 2010/01/10 09:38:50 robbat2 Exp $
# Author(s): John Mylchreest <johnm@gentoo.org>,
# Stefan Schweizer <genstef@gentoo.org>
@@ -150,7 +150,7 @@ check_vermagic() {
local curr_gcc_ver=$(gcc -dumpversion)
local tmpfile old_chost old_gcc_ver result=0
- tmpfile=`find ${KV_DIR}/ -iname "*.o.cmd" -exec grep usr/lib/gcc {} \; -quit`
+ tmpfile=`find "${KV_DIR}/" -iname "*.o.cmd" -exec grep usr/lib/gcc {} \; -quit`
tmpfile=${tmpfile//*usr/lib}
tmpfile=${tmpfile//\/include*}
old_chost=${tmpfile//*gcc\/}
@@ -211,7 +211,7 @@ convert_to_m() {
[ ! -f "${1}" ] && \
die "convert_to_m() requires a filename as an argument"
ebegin "Converting ${1/${WORKDIR}\//} to use M= instead of SUBDIRS="
- sed -i 's:SUBDIRS=:M=:g' ${1}
+ sed -i 's:SUBDIRS=:M=:g' "${1}"
eend $?
fi
}
@@ -228,9 +228,9 @@ update_depmod() {
get_version;
ebegin "Updating module dependencies for ${KV_FULL}"
- if [ -r ${KV_OUT_DIR}/System.map ]
+ if [ -r "${KV_OUT_DIR}"/System.map ]
then
- depmod -ae -F ${KV_OUT_DIR}/System.map -b ${ROOT} -r ${KV_FULL}
+ depmod -ae -F "${KV_OUT_DIR}"/System.map -b "${ROOT}" -r ${KV_FULL}
eend $?
else
ewarn
@@ -250,12 +250,12 @@ update_modules() {
debug-print-function ${FUNCNAME} $*
if [ -x /sbin/update-modules ] && \
- grep -v -e "^#" -e "^$" ${D}/etc/modules.d/* >/dev/null 2>&1; then
+ grep -v -e "^#" -e "^$" "${D}"/etc/modules.d/* >/dev/null 2>&1; then
ebegin "Updating modules.conf"
/sbin/update-modules
eend $?
elif [ -x /sbin/update-modules ] && \
- grep -v -e "^#" -e "^$" ${D}/etc/modules.d/* >/dev/null 2>&1; then
+ grep -v -e "^#" -e "^$" "${D}"/etc/modules.d/* >/dev/null 2>&1; then
ebegin "Updating modules.conf"
/sbin/update-modules
eend $?
@@ -270,15 +270,15 @@ update_modules() {
move_old_moduledb() {
debug-print-function ${FUNCNAME} $*
- local OLDDIR=${ROOT}/usr/share/module-rebuild/
- local NEWDIR=${ROOT}/var/lib/module-rebuild/
+ local OLDDIR="${ROOT}"/usr/share/module-rebuild/
+ local NEWDIR="${ROOT}"/var/lib/module-rebuild/
- if [[ -f ${OLDDIR}/moduledb ]]; then
- [[ ! -d ${NEWDIR} ]] && mkdir -p ${NEWDIR}
- [[ ! -f ${NEWDIR}/moduledb ]] && \
- mv ${OLDDIR}/moduledb ${NEWDIR}/moduledb
- rm -f ${OLDDIR}/*
- rmdir ${OLDDIR}
+ if [[ -f "${OLDDIR}"/moduledb ]]; then
+ [[ ! -d "${NEWDIR}" ]] && mkdir -p "${NEWDIR}"
+ [[ ! -f "${NEWDIR}"/moduledb ]] && \
+ mv "${OLDDIR}"/moduledb "${NEWDIR}"/moduledb
+ rm -f "${OLDDIR}"/*
+ rmdir "${OLDDIR}"
fi
}
@@ -290,17 +290,17 @@ move_old_moduledb() {
update_moduledb() {
debug-print-function ${FUNCNAME} $*
- local MODULEDB_DIR=${ROOT}/var/lib/module-rebuild/
+ local MODULEDB_DIR="${ROOT}"/var/lib/module-rebuild/
move_old_moduledb
- if [[ ! -f ${MODULEDB_DIR}/moduledb ]]; then
- [[ ! -d ${MODULEDB_DIR} ]] && mkdir -p ${MODULEDB_DIR}
- touch ${MODULEDB_DIR}/moduledb
+ if [[ ! -f "${MODULEDB_DIR}"/moduledb ]]; then
+ [[ ! -d "${MODULEDB_DIR}" ]] && mkdir -p "${MODULEDB_DIR}"
+ touch "${MODULEDB_DIR}"/moduledb
fi
- if ! grep -qs ${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
+ echo "a:1:${CATEGORY}/${PN}-${PVR}" >> "${MODULEDB_DIR}"/moduledb
fi
}
@@ -313,12 +313,12 @@ update_moduledb() {
remove_moduledb() {
debug-print-function ${FUNCNAME} $*
- local MODULEDB_DIR=${ROOT}/var/lib/module-rebuild/
+ local MODULEDB_DIR="${ROOT}"/var/lib/module-rebuild/
move_old_moduledb
- if grep -qs ${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
+ sed -i -e "/.*${CATEGORY}\/${PN}-${PVR}.*/d" "${MODULEDB_DIR}"/moduledb
fi
}
@@ -416,36 +416,36 @@ generate_modulesd() {
ebegin "Preparing file for modules.d"
#-----------------------------------------------------------------------
- echo "# modules.d configuration file for ${currm}" >> ${module_config}
+ echo "# modules.d configuration file for ${currm}" >> "${module_config}"
#-----------------------------------------------------------------------
[[ -n ${module_docs} ]] && \
- echo "# For more information please read:" >> ${module_config}
+ echo "# For more information please read:" >> "${module_config}"
for t in ${module_docs}
do
- echo "# ${t//*\/}" >> ${module_config}
+ echo "# ${t//*\/}" >> "${module_config}"
done
- echo >> ${module_config}
+ echo >> "${module_config}"
#-----------------------------------------------------------------------
if [[ ${module_aliases} -gt 0 ]]
then
- echo "# Internal Aliases - Do not edit" >> ${module_config}
- echo "# ------------------------------" >> ${module_config}
+ echo "# Internal Aliases - Do not edit" >> "${module_config}"
+ echo "# ------------------------------" >> "${module_config}"
for((t=0; t<${module_aliases}; t++))
do
echo "alias $(eval echo \${MODULESD_${currm}_ALIASES[$t]})" \
- >> ${module_config}
+ >> "${module_config}"
done
- echo '' >> ${module_config}
+ echo '' >> "${module_config}"
fi
#-----------------------------------------------------------------------
if [[ -n ${module_modinfo} ]]
then
- echo >> ${module_config}
- echo "# Configurable module parameters" >> ${module_config}
- echo "# ------------------------------" >> ${module_config}
+ echo >> "${module_config}"
+ echo "# Configurable module parameters" >> "${module_config}"
+ echo "# ------------------------------" >> "${module_config}"
myIFS="${IFS}"
IFS="$(echo -en "\n\b")"
@@ -456,10 +456,10 @@ generate_modulesd() {
then
module_opts="${module_opts} ${t%%:*}:${myVAR}"
fi
- echo -e "# ${t%%:*}:\t${t#*:}" >> ${module_config}
+ echo -e "# ${t%%:*}:\t${t#*:}" >> "${module_config}"
done
IFS="${myIFS}"
- echo '' >> ${module_config}
+ echo '' >> "${module_config}"
fi
#-----------------------------------------------------------------------
@@ -468,24 +468,24 @@ generate_modulesd() {
# So lets do some guesswork eh?
if [[ -n ${module_opts} ]]
then
- echo "# For Example..." >> ${module_config}
- echo "# --------------" >> ${module_config}
+ echo "# For Example..." >> "${module_config}"
+ echo "# --------------" >> "${module_config}"
for t in ${module_opts}
do
- echo "# options ${currm} ${t//:*}=${t//*:}" >> ${module_config}
+ echo "# options ${currm} ${t//:*}=${t//*:}" >> "${module_config}"
done
- echo '' >> ${module_config}
+ echo '' >> "${module_config}"
fi
elif [[ ${module_examples} -gt 0 ]]
then
- echo "# For Example..." >> ${module_config}
- echo "# --------------" >> ${module_config}
+ echo "# For Example..." >> "${module_config}"
+ echo "# --------------" >> "${module_config}"
for((t=0; t<${module_examples}; t++))
do
echo "options $(eval echo \${MODULESD_${currm}_EXAMPLES[$t]})" \
- >> ${module_config}
+ >> "${module_config}"
done
- echo '' >> ${module_config}
+ echo '' >> "${module_config}"
fi
#-----------------------------------------------------------------------
@@ -494,9 +494,9 @@ generate_modulesd() {
for((t=0; t<${module_additions}; t++))
do
echo "$(eval echo \${MODULESD_${currm}_ADDITIONS[$t]})" \
- >> ${module_config}
+ >> "${module_config}"
done
- echo '' >> ${module_config}
+ echo '' >> "${module_config}"
fi
#-----------------------------------------------------------------------
@@ -507,7 +507,7 @@ generate_modulesd() {
else
insinto /etc/modules.d
fi
- newins ${module_config} ${currm_path//*\/}.conf
+ newins "${module_config}" "${currm_path//*\/}.conf"
# and install any documentation we might have.
[[ -n ${module_docs} ]] && dodoc ${module_docs}
@@ -629,7 +629,7 @@ linux-mod_src_compile() {
if [ ! -f "${srcdir}/.built" ];
then
- cd ${srcdir}
+ cd "${srcdir}"
ln -s "${S}"/Module.symvers Module.symvers
einfo "Preparing ${modulename} module"
if [[ -n ${ECONF_PARAMS} ]]
@@ -650,8 +650,8 @@ linux-mod_src_compile() {
${BUILD_PARAMS} \
${BUILD_TARGETS} " \
|| die "Unable to emake HOSTCC="$(tc-getBUILD_CC)" CROSS_COMPILE=${CHOST}- LDFLAGS="$(get_abi_LDFLAGS)" ${BUILD_FIXES} ${BUILD_PARAMS} ${BUILD_TARGETS}"
- cd ${OLDPWD}
- touch ${srcdir}/.built
+ cd "${OLDPWD}"
+ touch "${srcdir}"/.built
fi
done
@@ -688,12 +688,12 @@ linux-mod_src_install() {
objdir=${objdir:-${srcdir}}
einfo "Installing ${modulename} module"
- cd ${objdir} || die "${objdir} does not exist"
+ cd "${objdir}" || die "${objdir} does not exist"
insinto /lib/modules/${KV_FULL}/${libdir}
doins ${modulename}.${KV_OBJ} || die "doins ${modulename}.${KV_OBJ} failed"
- cd ${OLDPWD}
+ cd "${OLDPWD}"
- generate_modulesd ${objdir}/${modulename}
+ generate_modulesd "${objdir}/${modulename}"
done
}
next reply other threads:[~2010-01-10 9:38 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-10 9:38 Robin H. Johnson (robbat2) [this message]
-- strict thread matches above, loose matches on Subject: below --
2013-08-24 11:07 [gentoo-commits] gentoo-x86 commit in eclass: linux-mod.eclass Samuli Suominen (ssuominen)
2013-03-26 8:17 Samuli Suominen (ssuominen)
2013-03-26 7:36 Samuli Suominen (ssuominen)
2013-03-24 14:16 Samuli Suominen (ssuominen)
2013-03-24 9:54 Samuli Suominen (ssuominen)
2011-08-09 22:11 Mike Frysinger (vapier)
2011-06-01 6:51 Robin H. Johnson (robbat2)
2011-05-27 9:46 Brian Harring (ferringb)
2011-04-24 18:55 Ulrich Mueller (ulm)
2010-03-31 19:33 Robin H. Johnson (robbat2)
2010-01-17 4:00 Robin H. Johnson (robbat2)
2010-01-17 3:54 Robin H. Johnson (robbat2)
2009-07-15 17:21 Mike Pagano (mpagano)
2008-11-05 12:00 Daniel Drake (dsd)
2008-11-02 3:02 Gordon Malm (gengor)
2008-11-01 23:19 Daniel Drake (dsd)
2008-11-01 14:56 Gordon Malm (gengor)
2008-10-31 23:43 Gordon Malm (gengor)
2008-10-31 23:37 Gordon Malm (gengor)
2008-10-31 22:31 Daniel Drake (dsd)
2008-10-31 22:24 Daniel Drake (dsd)
2008-10-31 21:25 Daniel Drake (dsd)
2008-10-27 5:22 Mike Frysinger (vapier)
2008-10-27 5:20 Mike Frysinger (vapier)
2008-09-30 5:27 Mike Frysinger (vapier)
2008-04-03 16:11 Doug Klima (cardoe)
2008-04-03 14:59 Stefan Schweizer (genstef)
2008-03-22 1:10 Robin H. Johnson (robbat2)
2007-11-16 6:12 Zac Medico (zmedico)
2007-10-03 12:55 Christian Heim (phreak)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=E1NTuG2-0004ob-UY@stork.gentoo.org \
--to=robbat2@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox