NetBSD-Bugs archive

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

Re: bin/42658: make(1) .include not properly handling directories with spaces in name



The following reply was made to PR bin/42658; it has been noted by GNATS.

From: Geoff Wing <gcw%pobox.com@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: 
Subject: Re: bin/42658: make(1) .include not properly handling directories
 with spaces in name
Date: Mon, 25 Jan 2010 11:33:54 +1100

 On Friday 2010-01-22 22:25 +0000, David Laight output:
 : Due to the way make works (treating a space as a separator, and having
 : no general method of escaping special characters) it really doesn't like 
 : spaces in any filenames (it won't like $ either).
 
 Just my misdiagnosis.  The problem was in the included file: bsd.own.mk
 The argument to ``cd'' needs quotes.
 
 Regards,
 Geoff
 
 --- share/mk/bsd.dep.mk.org    2008-10-27 12:02:50.000000000 +1100
 +++ share/mk/bsd.dep.mk        2010-01-25 11:30:53.000000000 +1100
 @@ -74,7 +74,7 @@
  .if !target(tags)
  tags: ${SRCS}
  .if defined(SRCS)
 -      -cd ${.CURDIR}; ctags -f /dev/stdout ${.ALLSRC:N*.h} | \
 +      -cd "${.CURDIR}"; ctags -f /dev/stdout ${.ALLSRC:N*.h} | \
            ${TOOL_SED} "s;\${.CURDIR}/;;" > tags
  .endif
  .endif
 --- share/mk/bsd.kernobj.mk.org        2003-10-12 16:41:01.000000000 +1000
 +++ share/mk/bsd.kernobj.mk    2010-01-25 11:30:59.000000000 +1100
 @@ -22,5 +22,5 @@
  KERNARCHDIR?= arch/${MACHINE}
  KERNCONFDIR?= ${KERNSRCDIR}/${KERNARCHDIR}/conf
  .if !defined(KERNOBJDIR) && exists(${KERNSRCDIR}/${KERNARCHDIR}/compile)
 -KERNOBJDIR!=  cd ${KERNSRCDIR}/${KERNARCHDIR}/compile && ${PRINTOBJDIR}
 +KERNOBJDIR!=  cd "${KERNSRCDIR}/${KERNARCHDIR}/compile" && ${PRINTOBJDIR}
  .endif
 --- share/mk/bsd.lib.mk.org    2010-01-02 12:36:51.000000000 +1100
 +++ share/mk/bsd.lib.mk        2010-01-25 11:31:11.000000000 +1100
 @@ -52,7 +52,7 @@
  .if defined(LIBDPLIBS) && ${MKPIC} != "no"                            # {
  .for _lib _dir in ${LIBDPLIBS}
  .if !defined(LIBDO.${_lib})
 -LIBDO.${_lib}!=       cd ${_dir} && ${PRINTOBJDIR}
 +LIBDO.${_lib}!=       cd "${_dir}" && ${PRINTOBJDIR}
  .MAKEOVERRIDES+=LIBDO.${_lib}
  .endif
  LDADD+=               -L${LIBDO.${_lib}} -l${_lib}
 @@ -84,7 +84,7 @@
  .if !defined(NOCHECKVER) && !defined(NOCHECKVER_${LIB}) && \
        exists(${NETBSDSRCDIR}/lib/checkver)
  checkver:
 -      @(cd ${.CURDIR} && \
 +      @(cd "${.CURDIR}" && \
            HOST_SH=${HOST_SH:Q} AWK=${TOOL_AWK:Q} \
            ${HOST_SH} ${NETBSDSRCDIR}/lib/checkver -v ${SHLIB_VERSION_FILE} \
                    -d ${DESTDIR}${_LIBSODIR} ${LIB})
 --- share/mk/bsd.obj.mk.org    2007-12-12 08:35:01.000000000 +1100
 +++ share/mk/bsd.obj.mk        2010-01-25 11:31:21.000000000 +1100
 @@ -52,7 +52,7 @@
  # In case .CURDIR has been twiddled by a .mk file and is now relative,
  # make it absolute again.
  .if ${__curdir:M/*} == ""
 -__curdir!=    cd ${__curdir} && ${PAWD}
 +__curdir!=    cd "${__curdir}" && ${PAWD}
  .endif
  
  __objdir:=    ${__objdir}.${HOST_OSTYPE}
 @@ -66,7 +66,7 @@
  .endif
  
  obj:
 -      @cd ${__curdir}; \
 +      @cd "${__curdir}"; \
        here=`${PAWD}`/; subdir=$${here#${BSDSRCDIR}/}; \
        if [ "$$here" != "$$subdir" ]; then \
                if [ ! -d ${__usrobjdir} ]; then \
 --- share/mk/bsd.own.mk.org    2009-12-15 10:05:54.000000000 +1100
 +++ share/mk/bsd.own.mk        2010-01-25 11:30:28.000000000 +1100
 @@ -81,7 +81,7 @@
  # and setting _SRC_TOP_ to the result.
  #
  .if !defined(_SRC_TOP_)                       # {
 -_SRC_TOP_!= cd ${.CURDIR}; while :; do \
 +_SRC_TOP_!= cd "${.CURDIR}"; while :; do \
                here=`pwd`; \
                [ -f build.sh  ] && [ -d tools ] && { echo $$here; break; }; \
                case $$here in /) echo ""; break;; esac; \
 @@ -100,7 +100,7 @@
  NETBSDSRCDIR?=        ${_SRC_TOP_}
  
  .if !defined(_SRC_TOP_OBJ_)
 -_SRC_TOP_OBJ_!=               cd ${_SRC_TOP_} && ${PRINTOBJDIR}
 +_SRC_TOP_OBJ_!=               cd "${_SRC_TOP_}" && ${PRINTOBJDIR}
  .MAKEOVERRIDES+=      _SRC_TOP_OBJ_
  .endif
  
 @@ -612,7 +612,7 @@
  cleandir:     clean
  
  dependall:    .NOTMAIN realdepend .MAKE
 -      @cd ${.CURDIR}; ${MAKE} realall
 +      @cd "${.CURDIR}"; ${MAKE} realall
  .endif
  
  #
 @@ -860,7 +860,7 @@
  #
  .if !defined(X11SRCDIR)
  .if exists(${NETBSDSRCDIR}/../xsrc)
 -X11SRCDIR!=           cd ${NETBSDSRCDIR}/../xsrc && pwd
 +X11SRCDIR!=           cd "${NETBSDSRCDIR}/../xsrc" && pwd
  .else
  X11SRCDIR=            /usr/xsrc
  .endif
 @@ -955,7 +955,7 @@
  #
  .if !defined(EXTSRCSRCDIR)
  .if exists(${NETBSDSRCDIR}/../extsrc)
 -EXTSRCSRCDIR!=                cd ${NETBSDSRCDIR}/../extsrc && pwd
 +EXTSRCSRCDIR!=                cd "${NETBSDSRCDIR}/../extsrc" && pwd
  .else
  EXTSRCSRCDIR=         /usr/extsrc
  .endif
 


Home | Main Index | Thread Index | Old Index