Bug 220737

Summary: Mk/bsd.java.mk: Strict JAVA_{VERSION,VENDOR,ERROR} validation
Product: Ports & Packages Reporter: Kyle Evans <kevans>
Component: Ports FrameworkAssignee: Kyle Evans <kevans>
Status: Closed FIXED    
Severity: Affects Only Me CC: java, portmgr, ports-bugs
Priority: --- Keywords: needs-qa
Version: LatestFlags: bapt: maintainer-feedback+
antoine: exp-run+
Hardware: Any   
OS: Any   
Attachments:
Description Flags
svn(1) diff of Mk/bsd.java.mk koobs: maintainer-approval? (java), koobs: maintainer-approval? (portmgr)

Description Kyle Evans freebsd_committer freebsd_triage 2017-07-14 20:05:05 UTC
Created attachment 184363 [details]
svn(1) diff of Mk/bsd.java.mk

Noticed while working in the regex around here: validation of JAVA_{VERSION,VENDOR,ERROR} does not constitute an error and make(1) will happily continue, potentially doing the wrong thing. Attached patch adjusts it as follows:

* Only validate each var if it's defined
* Also echo "not a valid value" message if the checked var is empty
* Fail the build if validation fails
Comment 1 Kyle Evans freebsd_committer freebsd_triage 2017-07-14 20:22:14 UTC
For some historical value: It looks like this validation was previously strict up until r217132 by kris@ inadvertently changed this.
Comment 2 Antoine Brodin freebsd_committer freebsd_triage 2017-08-12 06:17:31 UTC
Can someone review this before the exp-run?
Comment 3 Baptiste Daroussin freebsd_committer freebsd_triage 2017-08-23 14:54:25 UTC
Please proceed on the exp-run
Comment 4 Antoine Brodin freebsd_committer freebsd_triage 2017-08-25 08:15:17 UTC
Exp-run looks fine.
Comment 5 commit-hook freebsd_committer freebsd_triage 2017-11-04 01:16:57 UTC
A commit references this bug:

Author: kevans
Date: Sat Nov  4 01:16:32 UTC 2017
New revision: 453438
URL: https://svnweb.freebsd.org/changeset/ports/453438

Log:
  Mk/bsd.java.mk: Strict JAVA_{VERSION,VENDOR,ERROR} validation

  Currently, validation of JAVA_{VERSION,VENDOR,ERROR} does not constitute an
  error and make(1) will happily continue, potentially doing the wrong thing.
  Adjust the behavior as follows:

  - Only validate each var if it's defined
  - Remain verbose about what error exists and what's expected
  - Fail the build if validation fails

  bsd.java.mk exhibited this behavior up until r217132 inadvertently changed
  it to be non-fatal.

  PR:		220737
  Approved by:	portmgr (bdrewery)

Changes:
  head/Mk/bsd.java.mk