Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/etc When doing a "for" loop over a potentially-empty list



details:   https://anonhg.NetBSD.org/src/rev/7adb707d506b
branches:  trunk
changeset: 524890:7adb707d506b
user:      bjh21 <bjh21%NetBSD.org@localhost>
date:      Mon Apr 01 17:32:19 2002 +0000

description:
When doing a "for" loop over a potentially-empty list
(${KERNEL_SUFFIXES}), put the list in a shell variable and use that.
Both bash (before 2.05a) and Solaris /usr/xpg4/bin/sh report a syntax
error otherwise.

diffstat:

 etc/Makefile |  8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diffs (35 lines):

diff -r b0e9b78e085c -r 7adb707d506b etc/Makefile
--- a/etc/Makefile      Mon Apr 01 17:30:02 2002 +0000
+++ b/etc/Makefile      Mon Apr 01 17:32:19 2002 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.206 2002/03/31 16:07:53 bjh21 Exp $
+#      $NetBSD: Makefile,v 1.207 2002/04/01 17:32:19 bjh21 Exp $
 #      from: @(#)Makefile      8.7 (Berkeley) 5/25/95
 
 # Environment variables without default values:
@@ -360,10 +360,11 @@
 .for configfile in ${KERNEL_SETS}
        kernlist=`${GETKERNELAWK} ${KERNCONFDIR}/${configfile}`; \
        kerndir=${KERNOBJDIR}/${configfile:C/.*\///}; \
+       kernsuffixes="${KERNEL_SUFFIXES}"; \
        cd $${kerndir} && \
                tarlist=`for kernel in $${kernlist}; do \
                        echo "$${kernel}"; \
-                       for s in ${KERNEL_SUFFIXES}; do \
+                       for s in $${kernsuffixes}; do \
                                if [ -f $${kernel}.$${s} ]; then \
                                        echo "$${kernel}.$${s}"; \
                                fi; \
@@ -375,10 +376,11 @@
 .for configfile in ${KERNEL_SETS} ${EXTRA_KERNELS}
        kernlist=`${GETKERNELAWK} ${KERNCONFDIR}/${configfile:C/.*\///}`; \
        kerndir=${KERNOBJDIR}/${configfile:C/.*\///}; \
+       kernsuffixes="${KERNEL_SUFFIXES}"; \
        cd $${kerndir} &&       \
                gziplist=`for kernel in $${kernlist}; do \
                        echo "$${kernel}"; \
-                       for s in ${KERNEL_SUFFIXES}; do \
+                       for s in $${kernsuffixes}; do \
                                if [ -f $${kernel}.$${s} ]; then \
                                        echo "$${kernel}.$${s}"; \
                                fi; \



Home | Main Index | Thread Index | Old Index