diff options
author | Dan McGee <dan@archlinux.org> | 2011-01-31 02:15:53 +0100 |
---|---|---|
committer | Thomas Bächler <thomas@archlinux.org> | 2011-01-31 21:44:35 +0100 |
commit | 643e98eeb42677a9ce8c32fa44d4ee61d02f7fcf (patch) | |
tree | 4741c749f06e3dd96260fc8b6f7d49a477f7853c /mkinitcpio | |
parent | 19989173595b854ccd745f932864cf891606613c (diff) | |
download | mkinitcpio-643e98eeb42677a9ce8c32fa44d4ee61d02f7fcf.tar.gz mkinitcpio-643e98eeb42677a9ce8c32fa44d4ee61d02f7fcf.tar.xz |
Use new helper functions instead of system commands
Replace all of the repeated calls to dirname and basename with our new
replacments. Also replace the 'grep ... /dev/null' idiom with calls to
'grep -q', which does exactly what we want.
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'mkinitcpio')
-rwxr-xr-x | mkinitcpio | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -242,8 +242,8 @@ for hook in ${HOOKS}; do # within $INSTDIR. if [ -h "${INSTDIR}/${hook}" ]; then newhook="$(readlink -ne "${INSTDIR}/${hook}")" - if [ -n "${newhook}" -a "${INSTDIR}/$(basename ${newhook})" -ef "${newhook}" ]; then - newhook="$(basename ${newhook})" + if [ -n "${newhook}" -a "${INSTDIR}/$(get_basename ${newhook})" -ef "${newhook}" ]; then + newhook="$(get_basename ${newhook})" echo " -------------------------------------------------------------------" echo " WARNING: Hook \"${hook}\" is deprecated." echo " Replace it with \"${newhook}\" in your configuration file." @@ -251,7 +251,7 @@ for hook in ${HOOKS}; do hook="${newhook}" fi fi - if grep "install" "${INSTDIR}/${hook}" >/dev/null 2>&1; then + if grep -q "install" "${INSTDIR}/${hook}"; then . "${INSTDIR}/${hook}" echo ":: Parsing hook [${hook}]" install @@ -264,7 +264,7 @@ done if [ "${HAS_MODULES}" = "y" ]; then echo ":: Generating module dependencies" for mod in $(grep "file /lib/modules/${KERNELVERSION}" ${FILELIST} | cut -d' ' -f2); do - dir=$(dirname "${mod}") + dir=$(get_dirname "${mod}") mkdir -p "${TMPDIR}/${dir}" cp "${BASEDIR}${mod}" "${TMPDIR}/${dir}/" done |