Bug 193451

Summary: Error when port has OPTIONS_SINGLE and ports-mgmt/dialog4ports is not installed
Product: Ports & Packages Reporter: dmitry2004
Component: Ports FrameworkAssignee: freebsd-ports-bugs (Nobody) <ports-bugs>
Status: Closed FIXED    
Severity: Affects Some People CC: mat, rum1cro
Priority: Normal Keywords: needs-qa
Version: Latest   
Hardware: Any   
OS: Any   

Description dmitry2004 2014-09-08 04:54:00 UTC
When i do 'make config' on fresh system without installed dialog4ports and port Makefile contains OPTIONS_SINGLE:

root@local:/usr/ports/www/nginx # make config
===> Building/installing dialog4ports as it is required for the config dialog
===>  Cleaning for dialog4ports-0.1.5_2
===> Skipping 'config' as NO_DIALOG is defined
===>  License BSD2CLAUSE accepted by the user
====> You must select one and only one option from the VIDEO single
*** Error code 1

Stop.
make[2]: stopped in /usr/ports/ports-mgmt/dialog4ports
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/ports-mgmt/dialog4ports
===> Options unchanged
Comment 1 ru_M1cRO 2014-09-09 10:29:34 UTC
Yes, I know regarding this issue ;(
Need to change options "single" to "radio", because "single" should have one selected option:
-OPTIONS_SINGLE=		VIDEO
-OPTIONS_SINGLE_VIDEO=	HTTP_MP4 HTTP_MP4_H264
+OPTIONS_RADIO=		VIDEO
+OPTIONS_RADIO_VIDEO=	HTTP_MP4 HTTP_MP4_H264

I'll push patch to nginx port.
Comment 2 Mathieu Arnold freebsd_committer freebsd_triage 2014-09-09 11:22:51 UTC
Not really a framework problem.
Comment 3 dmitry2004 2014-09-09 16:29:45 UTC
(In reply to Mathieu Arnold from comment #2)
> Not really a framework problem.

what do you mean?

This problem I had with the other ports, not only nginx.
Problem = ports-mgmt/dialog4ports return error when try installed automatically - his error about options from base ports that do not relate to him
Comment 4 dmitry2004 2014-09-09 16:40:41 UTC
other example

root@local:~ # cd /usr/ports/databases/postgresql94-server/
root@local:/usr/ports/databases/postgresql94-server #	make config
===> Building/installing dialog4ports as it is required for the config dialog
===>  Cleaning for dialog4ports-0.1.5_2
===> Skipping 'config' as NO_DIALOG is defined
===>  License BSD2CLAUSE accepted by the user
====> You must select one and only one option from the KRB5 single
*** Error code 1

Stop.
make[2]: stopped in /usr/ports/ports-mgmt/dialog4ports
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/ports-mgmt/dialog4ports
===> Options unchanged
Comment 5 Mathieu Arnold freebsd_committer freebsd_triage 2014-09-09 20:25:56 UTC
Because when you use OPTIONS_SINGLE, you must put one of the values of each of the single groups to OPTIONS_DEFAULT, otherwise it's not valid.

The ports you're talking about have bugs in the way their options are implemented.
Comment 6 dmitry2004 2014-09-09 20:32:04 UTC
(In reply to Mathieu Arnold from comment #5)
> Because when you use OPTIONS_SINGLE, you must put one of the values of each
> of the single groups to OPTIONS_DEFAULT, otherwise it's not valid.
> 
> The ports you're talking about have bugs in the way their options are
> implemented.

But this should not affect on install ports-mgmt/dialog4ports for 'make config'
Comment 7 Mathieu Arnold freebsd_committer freebsd_triage 2014-09-09 20:38:59 UTC
(In reply to dmitry2004 from comment #6)
> (In reply to Mathieu Arnold from comment #5)
> > Because when you use OPTIONS_SINGLE, you must put one of the values of each
> > of the single groups to OPTIONS_DEFAULT, otherwise it's not valid.
> > 
> > The ports you're talking about have bugs in the way their options are
> > implemented.
> 
> But this should not affect on install ports-mgmt/dialog4ports for 'make
> config'

From the examples you gave, you have NO_DIALOG defined, so dialog4ports is *NOT* installed, because you asked for it.  It is not installed, and then, nginx or postgresql94-server break because their options are invalid.

unset NO_DIALOG, then dialog4ports will install itself, and you will be able to set the options with it.
Comment 8 dmitry2004 2014-09-09 20:42:20 UTC
(In reply to Mathieu Arnold from comment #7)
> (In reply to dmitry2004 from comment #6)
> > (In reply to Mathieu Arnold from comment #5)
> > > Because when you use OPTIONS_SINGLE, you must put one of the values of each
> > > of the single groups to OPTIONS_DEFAULT, otherwise it's not valid.
> > > 
> > > The ports you're talking about have bugs in the way their options are
> > > implemented.
> > 
> > But this should not affect on install ports-mgmt/dialog4ports for 'make
> > config'
> 
> From the examples you gave, you have NO_DIALOG defined, so dialog4ports is
> *NOT* installed, because you asked for it.  It is not installed, and then,
> nginx or postgresql94-server break because their options are invalid.
> 
> unset NO_DIALOG, then dialog4ports will install itself, and you will be able
> to set the options with it.

NO_DIALOG set ports-mgmt/dialog4ports when try install itself
see ports/Mk/Scripts/dialog4ports.sh
Comment 9 Mathieu Arnold freebsd_committer freebsd_triage 2014-09-10 12:20:52 UTC
(In reply to dmitry2004 from comment #8)
> NO_DIALOG set ports-mgmt/dialog4ports when try install itself
> see ports/Mk/Scripts/dialog4ports.sh

What exactly do you have in your environment, can you give a test case that we can reproduce ?
Comment 10 dmitry2004 2014-09-10 12:52:20 UTC
(In reply to Mathieu Arnold from comment #9)
> (In reply to dmitry2004 from comment #8)
> > NO_DIALOG set ports-mgmt/dialog4ports when try install itself
> > see ports/Mk/Scripts/dialog4ports.sh
> 
> What exactly do you have in your environment, can you give a test case that
> we can reproduce ?

Test case:

root@local:~ # pkg delete dialog4ports
Ok

root@local:~ # cd /usr/ports/databases/postgresql94-server/
root@local:/usr/ports/databases/postgresql94-server # make config
===> Building/installing dialog4ports as it is required for the config dialog
===>  Cleaning for dialog4ports-0.1.5_2
===> Skipping 'config' as NO_DIALOG is defined
===>  License BSD2CLAUSE accepted by the user
====> You must select one and only one option from the KRB5 single
*** Error code 1

Stop.
make[2]: stopped in /usr/ports/ports-mgmt/dialog4ports
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/ports-mgmt/dialog4ports
===> Options unchanged
Comment 11 Baptiste Daroussin freebsd_committer freebsd_triage 2014-09-10 13:34:50 UTC
Everything works as expected here.

The bootstrap sets NO_DIALOG only for dialog4ports not for other ports.

The problem you are seeing are bugs ports per ports and maintainer needs to be poked about it

The problem you are spotting has to be report port by port and fixed.

I have fixed postgresql
Comment 12 commit-hook freebsd_committer freebsd_triage 2014-09-10 13:35:02 UTC
A commit references this bug:

Author: bapt
Date: Wed Sep 10 13:34:54 UTC 2014
New revision: 367837
URL: http://svnweb.freebsd.org/changeset/ports/367837

Log:
  Turn OPTIONS_SINGLE KRB5 into an OPTIONS_RADIO like it is supposed to be

  PR:		193451
  Submitted by:	dmitry2004@yandex.ru

Changes:
  head/databases/postgresql91-server/Makefile
  head/databases/postgresql92-server/Makefile
Comment 13 dmitry2004 2014-09-28 09:21:50 UTC
Works for me