Make lb_chroot_hooks work with dash.

Apparently, dash doesn't expand shell patterns within a quoted string,
whereas bash does. We can't remove the quoting entirely, though, since
that would cause problems when $LB_BASE or $_HOOK contains spaces (note
that $_HOOK can probably never contain spaces, but let's handle it just
in case). Only quoting the expansion of $LB_BASE and $_HOOK, but not the
shell pattern should make the hooks work with both bash and dash again.
This commit is contained in:
Matthijs Kooijman 2012-01-10 14:44:42 +01:00
parent 65f256f893
commit dbe6a82bc0
1 changed files with 2 additions and 2 deletions

View File

@ -43,10 +43,10 @@ Create_lockfile .lock
# Copying hooks
for _HOOK in ${LB_CHROOT_HOOKS}
do
if [ -e "${LB_BASE}/hooks/???-${_HOOK}.chroot" ]
if [ -e "${LB_BASE}"/hooks/???-"${_HOOK}".chroot ]
then
mkdir -p chroot/root/lb_chroot_hooks
cp "${LB_BASE}/hooks/???-${_HOOK}.chroot" chroot/root/lb_chroot_hooks
cp "${LB_BASE}"/hooks/???-"${_HOOK}".chroot chroot/root/lb_chroot_hooks
fi
done