Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 19 Apr 2015 19:34:06 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-ports-bugs@FreeBSD.org
Subject:   [Bug 199550] Mk/bsd.port.mk: COPYTREE_* escaping glob/shell patterns
Message-ID:  <bug-199550-13@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=199550

            Bug ID: 199550
           Summary: Mk/bsd.port.mk: COPYTREE_* escaping glob/shell
                    patterns
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: Ports Framework
          Assignee: portmgr@FreeBSD.org
          Reporter: jbeich@FreeBSD.org
                CC: freebsd-ports-bugs@FreeBSD.org

Created attachment 155744
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=155744&action=edit
v0

Trying to optimize find(1) primaries in attachment 149511 I've noticed the 3rd
argument is always expanded. This makes it harder to exclude files based on
regex or shell globs. One could try to escape meta characters with \
(backslash) but it doesn't work because \ isn't stripped in the output.

  post-install:
          (cd ${WRKSRC}/manual && ${COPYTREE_SHARE} \
                  . ${STAGEDIR}${DOCSDIR} "! -name Makefile\*")

Here's the illustration:

  $ sh -c 'cd /var/empty; echo $0' -- "*"
  *

  $ sh -c 'cd /bin; echo $0' -- "*"
  [ cat chflags ...

  $ sh -c 'cd /bin; echo $0' -- "\*"
  \*

  $ sh -c 'cd /bin; echo $0' -- "\\*"
  \*

  $ sh -c 'cd /bin; echo $0' -- "'*'"
  '*'

One way to strip quoting is via `eval' builtin:

  $ sh -c 'cd /bin; eval echo $0' -- "\*"
  *

  $ sh -c 'cd /bin; eval echo $0' -- "'*'"
  *

-- 
You are receiving this mail because:
You are on the CC list for the bug.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-199550-13>