Fix makefile by rewriting parts into shell code
authorSimon Schubert <corecode@dragonflybsd.org>
Mon, 1 Dec 2008 17:43:51 +0000 (18:43 +0100)
committerSimon Schubert <corecode@dragonflybsd.org>
Mon, 1 Dec 2008 18:59:24 +0000 (19:59 +0100)
We can't break one shell command by a make macro, or make will
split into multiple shell commands, thus losing environment (like the
pwd).

etc/Makefile

index 03a372f..103365f 100644 (file)
@@ -146,13 +146,12 @@ upgrade_etc:      preupgrade remove-obsolete-files
        cd ${UPGRADE_SRCDIR}; \
            ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
                ${BINUPDATE} ${DESTDIR}/etc; \
-           cap_mkdb ${DESTDIR}/etc/login.conf
-.for BIN1_FILE in ${BIN1}
-.if !exists(${DESTDIR}/etc/${BIN1_FILE:T})
-           ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
-               ${BIN1_FILE} ${DESTDIR}/etc
-.endif
-.endfor
+           cap_mkdb ${DESTDIR}/etc/login.conf; \
+           for f in ${BIN1}; do \
+               [ -e "${DESTDIR}/etc/$${f##*/}" ] || \
+                   ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
+                       $$f ${DESTDIR}/etc; \
+           done; \
            ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 555 \
                ${BIN2} ${DESTDIR}/etc;
        cd ${UPGRADE_SRCDIR}/defaults; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \