Bug 197540 - ORGANIZATION set in environment causes "make buildworld" to fail
Summary: ORGANIZATION set in environment causes "make buildworld" to fail
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: misc (show other bugs)
Version: 10.1-STABLE
Hardware: Any Any
: --- Affects Many People
Assignee: Glen Barber
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-02-11 15:56 UTC by karl
Modified: 2015-02-14 01:34 UTC (History)
0 users

See Also:


Attachments
Quote ORGANIZATION_NAME in case it is two or more words in length. (775 bytes, patch)
2015-02-11 18:40 UTC, Glen Barber
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description karl 2015-02-11 15:56:04 UTC
"make buildworld" fails in macro expansion if ORGANIZATION is set in the environment here:

--- util.o ---
cc  -O2 -pipe   -I/usr/src/usr.bin/svn/svn/../../../contrib/subversion/subversion/include -I/usr/src/usr.bin/svn/svn/../../../contrib/subversion/subversion -I/usr/src/usr.bin/svn/svn/..  -I/usr/src/usr.bin/svn/svn/../lib/libapr  -I/usr/src/usr.bin/svn/svn/../../../contrib/apr/include/arch/unix  -I/usr/src/usr.bin/svn/svn/../../../contrib/apr/include  -I/usr/src/usr.bin/svn/svn/../lib/libapr_util  -I/usr/src/usr.bin/svn/svn/../../../contrib/apr-util/include/private  -I/usr/src/usr.bin/svn/svn/../../../contrib/apr-util/include -I. -DHAS_ORGANIZATION_NAME -std=gnu99 -Qunused-arguments  -fstack-protector -Wno-pointer-sign -Wno-empty-body -Wno-string-plus-int -Wno-unused-const-variable -Wno-tautological-compare -Wno-unused-value -Wno-parentheses-equality -Wno-unused-function -Wno-enum-conversion -Wno-switch -Wno-switch-enum -Wno-knr-promoted-parameter -Wno-parentheses -c /usr/src/usr.bin/svn/svn/../../../contrib/subversion/subversion/svn/util.c
/usr/src/usr.bin/svn/svn/../../../contrib/subversion/subversion/svn/util.c:416:7: error: expected ')'
      ORGANIZATION_NAME
      ^
./freebsd-organization.h:1:27: note: expanded from macro 'ORGANIZATION_NAME'
#define ORGANIZATION_NAME Karls Sushi and Packet Smashers
                          ^
/usr/src/usr.bin/svn/svn/../../../contrib/subversion/subversion/svn/util.c:414:27: note: to match this '('
  svn_stringbuf_appendcstr(default_msg, "Sponsored by:\t"
                          ^
1 error generated.
*** [util.o] Error code 1

make[5]: stopped in /usr/src/usr.bin/svn/svn
1 error
Comment 1 Glen Barber freebsd_committer freebsd_triage 2015-02-11 16:01:19 UTC
You need to surround it in quotes.

 $ grep ^ORGANIZATION /etc/make.conf
 ORGANIZATION=          "The FreeBSD Foundation"
Comment 2 karl 2015-02-11 16:14:18 UTC
That did not used to be the case.
Comment 3 karl 2015-02-11 16:19:02 UTC
(In reply to Glen Barber from comment #1)

More specifically...

In .bash_profile:

ORGANIZATION="Karls Sushi and Packet Smashers"
export ORGANIZATION

fails if one logs in, executes su and then does a "make buildworld"

This did not used to be the case (and I argue it shouldn't be the case, since that would imply that one cannot set it locally in a user's profile as is expected for any other ordinary string value but rather must either set it in /etc/make.conf or escape the quotes.)
Comment 4 Glen Barber freebsd_committer freebsd_triage 2015-02-11 18:40:24 UTC
Created attachment 152873 [details]
Quote ORGANIZATION_NAME in case it is two or more words in length.

Will you please try the attached patch?
Comment 5 karl 2015-02-11 22:50:47 UTC
That patch is effective.
Comment 6 commit-hook freebsd_committer freebsd_triage 2015-02-11 22:59:40 UTC
A commit references this bug:

Author: gjb
Date: Wed Feb 11 22:59:25 UTC 2015
New revision: 278603
URL: https://svnweb.freebsd.org/changeset/base/278603

Log:
  Ensure ORGANIZATION_NAME is quoted when ORGANIZATION
  could contain strings of two or more words.

  Reviewed by:	peter
  Reported by:	karl@denninger.net
  PR:		197540
  MFC after:	3 days
  Sponsored by:	The FreeBSD Foundation

Changes:
  head/usr.bin/svn/svn/Makefile
Comment 7 Glen Barber freebsd_committer freebsd_triage 2015-02-11 23:01:23 UTC
Thank you for confirming.
Comment 8 commit-hook freebsd_committer freebsd_triage 2015-02-12 00:17:47 UTC
A commit references this bug:

Author: gjb
Date: Thu Feb 12 00:17:15 UTC 2015
New revision: 278607
URL: https://svnweb.freebsd.org/changeset/base/278607

Log:
  Reduce number of lines to set ORGANIZATION_NAME in
  freebsd-organization.h.

  Patched by:	ian
  PR:		197540
  MFC after:	3 days
  X-MFC-with:	r278603
  Sponsored by:	The FreeBSD Foundation

Changes:
  head/usr.bin/svn/svn/Makefile
Comment 9 commit-hook freebsd_committer freebsd_triage 2015-02-14 01:33:54 UTC
A commit references this bug:

Author: gjb
Date: Sat Feb 14 01:33:12 UTC 2015
New revision: 278740
URL: https://svnweb.freebsd.org/changeset/base/278740

Log:
  MFC r278603, r278607:

   r278603:
     Ensure ORGANIZATION_NAME is quoted when ORGANIZATION
     could contain strings of two or more words.

   r278607:
     Reduce number of lines to set ORGANIZATION_NAME in
     freebsd-organization.h.

  PR: 		197540
  Sponsored by:	The FreeBSD Foundation

Changes:
_U  stable/10/
  stable/10/usr.bin/svn/svn/Makefile
Comment 10 Glen Barber freebsd_committer freebsd_triage 2015-02-14 01:34:53 UTC
Merged to stable/10.  Thank you for the report.