Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 08 Oct 2017 19:44:53 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-ports-bugs@FreeBSD.org
Subject:   [Bug 222870] bsd.port.mk: COPYTREE_* do not work with POSIX-compliant sh -c
Message-ID:  <bug-222870-13@https.bugs.freebsd.org/bugzilla/>

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

            Bug ID: 222870
           Summary: bsd.port.mk: COPYTREE_* do not work with
                    POSIX-compliant sh -c
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: Ports Framework
          Assignee: portmgr@FreeBSD.org
          Reporter: jilles@FreeBSD.org
                CC: freebsd-ports-bugs@FreeBSD.org
            Blocks: 220587

Created attachment 187011
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D187011&action=
=3Dedit
allow both current and POSIX-compliant sh -c

The COPYTREE_BIN and COPYTREE_SHARE macros use constructs like

sh -c 'command' -- arg0 arg1

and assume that $0 will expand to arg0 and $1 will expand to arg1.

Our current sh implements it that way. However, POSIX specifies that $0 will
expand to -- and $1 will expand to arg0, since the command string is an ope=
rand
and not an option-argument. Bug #220587 requests making sh POSIX-compliant =
in
this regard.

If the argument after the command string does not start with '-', the curre=
nt
sh behaves as required by POSIX. Therefore, the macros should be adjusted so
this is always the case.

Tested with poudriere, stable/10 with patched head sh, port
textproc/docbook-sgml.


Referenced Bugs:

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D220587
[Bug 220587] /bin/sh Incorrect options handling
--=20
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-222870-13>