Ensure that the file used for replacing the template parameters is a file.
authorUlrich Dangel <mru@grml.org>
Tue, 20 Dec 2011 21:58:03 +0000 (22:58 +0100)
committerUlrich Dangel <mru@grml.org>
Tue, 20 Dec 2011 22:09:27 +0000 (23:09 +0100)
We now ship a directory within our grub template directory for our theme.
This will result in an sed error 'not a regular file' as the directory is
indeed no regular file. This make sure that the file used by sed is a regular
file.

grml-live

index 020e483..923c934 100755 (executable)
--- a/grml-live
+++ b/grml-live
@@ -929,7 +929,7 @@ if [ "$ARCH" = i386 ] || [ "$ARCH" = amd64 ] ; then
        # adjust all variables in the templates with the according distribution information
        for file in "${BUILD_OUTPUT}"/boot/isolinux/*.cfg "${BUILD_OUTPUT}"/boot/isolinux/*.msg \
                    "${BUILD_OUTPUT}"/boot/grub/* ; do
        # adjust all variables in the templates with the according distribution information
        for file in "${BUILD_OUTPUT}"/boot/isolinux/*.cfg "${BUILD_OUTPUT}"/boot/isolinux/*.msg \
                    "${BUILD_OUTPUT}"/boot/grub/* ; do
-         if [ -r "${file}" ] ; then
+         if [ -r "${file}" ] && [ -f "${file}" ] ; then
            sed -i "s/%ARCH%/$ARCH/g"                    "${file}"
            sed -i "s/%DATE%/$DATE/g"                    "${file}"
            sed -i "s/%DISTRI_INFO%/$DISTRI_INFO/g"      "${file}"
            sed -i "s/%ARCH%/$ARCH/g"                    "${file}"
            sed -i "s/%DATE%/$DATE/g"                    "${file}"
            sed -i "s/%DISTRI_INFO%/$DISTRI_INFO/g"      "${file}"