summaryrefslogtreecommitdiffstats
path: root/mkinitcpio
diff options
context:
space:
mode:
authorDave Reisner <d@falconindy.com>2011-06-05 18:06:31 +0200
committerDave Reisner <d@falconindy.com>2011-06-16 20:19:12 +0200
commitee9412dbcc1deb117af39990c3e777bc0994bb70 (patch)
tree793925a0904271f10f2572f5a260b0c248ea688f /mkinitcpio
parentde8365f4b60a8058ad6b649d34156f231a921b1b (diff)
downloadmkinitcpio-ee9412dbcc1deb117af39990c3e777bc0994bb70.tar.gz
mkinitcpio-ee9412dbcc1deb117af39990c3e777bc0994bb70.tar.xz
mkinitcpio: deprecate install() in install hooks
This is an unfortunate name clash with a common utility and should be avoided. Rename the install function to 'build' and warn the user when we discover a hook using an 'install' function. Signed-off-by: Dave Reisner <d@falconindy.com>
Diffstat (limited to 'mkinitcpio')
-rwxr-xr-xmkinitcpio23
1 files changed, 14 insertions, 9 deletions
diff --git a/mkinitcpio b/mkinitcpio
index 70710eb..201c4ce 100755
--- a/mkinitcpio
+++ b/mkinitcpio
@@ -226,7 +226,7 @@ MODULEDIR=$(echo ${MODULEDIR} | tr -s /)
if [ "${SHOW_AUTOMODS}" = "y" ]; then
echo "Modules autodetected:"
. "${INSTDIR}/autodetect"
- install
+ build
cat "${MODULE_FILE}"
cleanup
exit 0
@@ -242,10 +242,8 @@ parse_hook
for hook in ${HOOKS}; do
in_array ${hook} ${SKIPHOOKS[@]} && continue
- unset MODULES
- unset BINARIES
- unset FILES
- install () { msg "${hook}: no install function..."; }
+ unset MODULES BINARIES FILES
+ build () { msg "${hook}: no build function..."; }
# Deprecation check
# A hook is considered deprecated if it is a symlink
# within $INSTDIR.
@@ -260,10 +258,19 @@ for hook in ${HOOKS}; do
hook="${newhook}"
fi
fi
- if grep -q "install" "${INSTDIR}/${hook}"; then
+ if [[ -r "${INSTDIR}/${hook}" ]]; then
. "${INSTDIR}/${hook}"
echo ":: Parsing hook [${hook}]"
- install
+ if [[ $(type -t install) = 'function' ]]; then
+ echo " -----------------------------------------------------------------------"
+ echo " WARNING: Hook '$hook' uses a deprecated 'install' function. This "
+ echo " should be switched to a 'build' function instead."
+ echo " -----------------------------------------------------------------------"
+ install
+ unset install
+ else
+ build
+ fi
parse_hook
else
die "Hook '${hook}' can not be found."
@@ -272,8 +279,6 @@ done
if [ "${HAS_MODULES}" = "y" ]; then
echo ":: Generating module dependencies"
- # unfortuate name collision between a function and utility program
- unset install
for mod in $(grep "file /lib/modules/${KERNELVERSION}" ${FILELIST} | cut -d' ' -f2); do
install -m 644 -D "${BASEDIR}${mod}" "${TMPDIR}${mod}"
done