[Home]

Summary:ASTERISK-15187: [patch] menuselect.makeopts: does not properly unselect an option with a leading - (minus)
Reporter:abelbeck (abelbeck)Labels:
Date Opened:2009-11-20 15:41:20.000-0600Date Closed:2009-12-10 15:04:22.000-0600
Priority:MinorRegression?Yes
Status:Closed/CompleteComponents:Core/BuildSystem
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) asterisk-1.4-bugid16296.patch.txt
( 1) issue16296-20091210.diff
Description:The main asterisk Makefile no longer contains the line:

.PHONY: menuselect.makeopts

So the section...
menuselect.makeopts: menuselect/menuselect menuselect-tree etc...
 menuselect/menuselect --check-deps $@ $(GLOBAL_MAKEOPTS) $(USER_MAKEOPTS)

is now only called once.  The problem is if either GLOBAL_MAKEOPTS or USER_MAKEOPTS contains an option to be un-selected from the default by placing a - (minus) in front of the option, this no longer works.  (See Additional Information)

My fix is to call menuselect/menuselect twice, first to create a default menuselect.makeopts file and second to check/un-check any GLOBAL_MAKEOPTS or USER_MAKEOPTS options relative to the default options.

menuselect.makeopts: menuselect/menuselect menuselect-tree etc...
 menuselect/menuselect --check-deps $@
 menuselect/menuselect --check-deps $@ $(GLOBAL_MAKEOPTS) $(USER_MAKEOPTS)

This fix has been tested and works.

****** ADDITIONAL INFORMATION ******

https://issues.asterisk.org/view.php?id=12117 added the functionality to place a leading - (minus) to unselect an option. For Example...

The default generated Asterisk menuselect.makeopts contains the line:

MENUSELECT_MOH=MOH-OPSOUND-WAV

If a custom (GLOBAL_MAKEOPTS) asterisk.makeopts contains the line:

MENUSELECT_MOH=MOH-OPSOUND-ULAW MOH-OPSOUND-G729 -MOH-OPSOUND-WAV

Then, when working properly, yields the line:

MENUSELECT_MOH=MOH-OPSOUND-ULAW MOH-OPSOUND-G729
Comments:By: Philip Prindeville (pprindeville) 2009-11-20 17:03:16.000-0600

Does adding back the .PHONY target fix things?  That seems like it might be the simplest remedy if it works.

By: abelbeck (abelbeck) 2009-11-20 17:09:07.000-0600

Quite possibly, but I have not tested adding back...
.PHONY: menuselect.makeopts

The suggested, tested, solution is also quite simple.

By: Philip Prindeville (pprindeville) 2009-11-20 17:13:14.000-0600

That causes everyone building Asterisk to change how they do it.

I'm thinking that fixing the regression wouldn't cause anyone to have to change anything (except the Asterisk makefile, which broke).

Right?

What am I missing?

By: abelbeck (abelbeck) 2009-11-20 17:20:27.000-0600

Each solution only requires adding one line to the current Makefile.

Note: This problem also exists in the 1.6 branch.

By: Philip Prindeville (pprindeville) 2009-11-21 16:40:01.000-0600

I'm confused.  You're saying it's easier to change how the user invokes the Asterisk make process, than than to change that Makefile and have the invocation stay the same?

By: abelbeck (abelbeck) 2009-11-21 16:52:16.000-0600

No, the solution I suggest (adding the line: menuselect/menuselect --check-deps $@) in the main asterisk Makefile does not change how the user invokes the Asterisk make process.

The problem is menuselect.c does not handle both creating a new default menuselect.makeopts AND un-selecting options defined by GLOBAL_MAKEOPTS or USER_MAKEOPTS. Calling menuselect/menuselect twice solves the problem without rewriting menuselect.c .

By: Jason Parker (jparker) 2009-12-10 10:54:57.000-0600

Can you add this change as a patch?  It needs to be tracked properly for licensing purposes.

By: abelbeck (abelbeck) 2009-12-10 11:10:42.000-0600

asterisk-1.4-bugid16296.patch.txt attached, also applies to 1.6

By: Jason Parker (jparker) 2009-12-10 12:10:03.000-0600

I think this might actually be a slightly better way of doing this (it also fixes the case where you just run menuselect, with a GLOBAL_MAKEOPTS or USER_MAKEOPTS file).

Thoughts?

By: Leif Madsen (lmadsen) 2009-12-10 14:42:26.000-0600

I did a bunch of testing on this, and I couldn't get it to break. As far as I could tell, everything is working the same as it was previously (for normal menuselect selection/compiling stuff)

By: abelbeck (abelbeck) 2009-12-10 14:44:50.000-0600

I tested your (qwell) diff, and it also solves the issue.

By: Digium Subversion (svnbot) 2009-12-10 14:58:10.000-0600

Repository: asterisk
Revision: 234255

U   branches/1.4/Makefile

------------------------------------------------------------------------
r234255 | qwell | 2009-12-10 14:58:10 -0600 (Thu, 10 Dec 2009) | 9 lines

Fix unselecting of menuselect options via GLOBAL_MAKEOPTS and USER_MAKEOPTS.

(closes issue ASTERISK-15187)
Reported by: abelbeck
Patches:
     issue16296-20091210.diff uploaded by qwell (license 4)
(abelbeck described a fix, which I expanded upon)
Tested by: abelbeck, qwell, lmadsen

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=234255

By: Digium Subversion (svnbot) 2009-12-10 15:01:39.000-0600

Repository: asterisk
Revision: 234256

_U  trunk/
U   trunk/Makefile

------------------------------------------------------------------------
r234256 | qwell | 2009-12-10 15:01:39 -0600 (Thu, 10 Dec 2009) | 16 lines

Merged revisions 234255 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
 r234255 | qwell | 2009-12-10 14:58:09 -0600 (Thu, 10 Dec 2009) | 9 lines
 
 Fix unselecting of menuselect options via GLOBAL_MAKEOPTS and USER_MAKEOPTS.
 
 (closes issue ASTERISK-15187)
 Reported by: abelbeck
 Patches:
       issue16296-20091210.diff uploaded by qwell (license 4)
 (abelbeck described a fix, which I expanded upon)
 Tested by: abelbeck, qwell, lmadsen
........

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=234256

By: Digium Subversion (svnbot) 2009-12-10 15:03:00.000-0600

Repository: asterisk
Revision: 234257

_U  branches/1.6.0/
U   branches/1.6.0/Makefile

------------------------------------------------------------------------
r234257 | qwell | 2009-12-10 15:02:59 -0600 (Thu, 10 Dec 2009) | 23 lines

Merged revisions 234256 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
 r234256 | qwell | 2009-12-10 15:01:39 -0600 (Thu, 10 Dec 2009) | 16 lines
 
 Merged revisions 234255 via svnmerge from
 https://origsvn.digium.com/svn/asterisk/branches/1.4
 
 ........
   r234255 | qwell | 2009-12-10 14:58:09 -0600 (Thu, 10 Dec 2009) | 9 lines
   
   Fix unselecting of menuselect options via GLOBAL_MAKEOPTS and USER_MAKEOPTS.
   
   (closes issue ASTERISK-15187)
   Reported by: abelbeck
   Patches:
         issue16296-20091210.diff uploaded by qwell (license 4)
   (abelbeck described a fix, which I expanded upon)
   Tested by: abelbeck, qwell, lmadsen
 ........
................

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=234257

By: Digium Subversion (svnbot) 2009-12-10 15:03:41.000-0600

Repository: asterisk
Revision: 234258

_U  branches/1.6.1/
U   branches/1.6.1/Makefile

------------------------------------------------------------------------
r234258 | qwell | 2009-12-10 15:03:40 -0600 (Thu, 10 Dec 2009) | 23 lines

Merged revisions 234256 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
 r234256 | qwell | 2009-12-10 15:01:39 -0600 (Thu, 10 Dec 2009) | 16 lines
 
 Merged revisions 234255 via svnmerge from
 https://origsvn.digium.com/svn/asterisk/branches/1.4
 
 ........
   r234255 | qwell | 2009-12-10 14:58:09 -0600 (Thu, 10 Dec 2009) | 9 lines
   
   Fix unselecting of menuselect options via GLOBAL_MAKEOPTS and USER_MAKEOPTS.
   
   (closes issue ASTERISK-15187)
   Reported by: abelbeck
   Patches:
         issue16296-20091210.diff uploaded by qwell (license 4)
   (abelbeck described a fix, which I expanded upon)
   Tested by: abelbeck, qwell, lmadsen
 ........
................

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=234258

By: Digium Subversion (svnbot) 2009-12-10 15:04:21.000-0600

Repository: asterisk
Revision: 234259

_U  branches/1.6.2/
U   branches/1.6.2/Makefile

------------------------------------------------------------------------
r234259 | qwell | 2009-12-10 15:04:20 -0600 (Thu, 10 Dec 2009) | 23 lines

Merged revisions 234256 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
 r234256 | qwell | 2009-12-10 15:01:39 -0600 (Thu, 10 Dec 2009) | 16 lines
 
 Merged revisions 234255 via svnmerge from
 https://origsvn.digium.com/svn/asterisk/branches/1.4
 
 ........
   r234255 | qwell | 2009-12-10 14:58:09 -0600 (Thu, 10 Dec 2009) | 9 lines
   
   Fix unselecting of menuselect options via GLOBAL_MAKEOPTS and USER_MAKEOPTS.
   
   (closes issue ASTERISK-15187)
   Reported by: abelbeck
   Patches:
         issue16296-20091210.diff uploaded by qwell (license 4)
   (abelbeck described a fix, which I expanded upon)
   Tested by: abelbeck, qwell, lmadsen
 ........
................

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=234259