Summary:ASTERISK-15809: [patch] Makefile update to only build asterisk.conf
Reporter:Paul Belanger (pabelanger)Labels:
Date Opened:2010-03-14 11:37:06Date Closed:2010-05-04 19:22:33
Versions:Frequency of
Environment:Attachments:( 0) 0017027.asterisk.conf.v6.patch
Description:Sometime we only need to install the asterisk.conf file minus all the other .conf files.  So we created a new flag.

make asterisk.conf


Let me know if you want to rename the flag.
Comments:By: Jason Parker (jparker) 2010-03-15 10:30:10

I think it would be more appropriate for this to be a part of your packaging, rather than in Asterisk.  It's very specific to your setup, and wouldn't serve any purpose outside of it.

By: Leif Madsen (lmadsen) 2010-03-15 10:40:42

I disagree. This is useful when you want to do something like build your own configuration files from scratch rather than building from the sample files.

This is exactly the issue we've run into when writing documentation for Asterisk recently where I need to instruct someone to either use the 'asterisk.conf' file I've generated for them (which may or may not be accurate? I'm not entirely sure why it's generated in the first place and not just copied like the other sample files), or they have to do a 'make samples' first, then remove all the sample files other than the asterisk.conf file.

I'm in favour of including this, or at least defining why asterisk.conf is treated differently than the other sample files.

By: Paul Belanger (pabelanger) 2010-03-15 10:48:54

@qwell: lmadsen logic is the reason for this change. As it stand now, the only way to generate asterisk.conf is to run make samples, which also includes every other .conf in asterisk. Then we have to remove all the sample files to keep asterisk.conf.

By: Paul Belanger (pabelanger) 2010-04-14 14:54:11

update issue to include Reviewboard link.

By: David Chappell (chappell) 2010-04-14 21:56:57

I hope "make asterisk.conf" does not overwrite /etc/asterisk/asterisk.conf.
If it is really necessary to have a make target which builds asterisk.conf and installs it, it should be called "make install-asterisk.conf", not "make asterisk.conf".

(I consider the behavior of "make config" dangerous.  I recently found a reference to "the asterisk.conf generated by make config".  I tried it and it overwrote my configuration files!  If it is going to install configuration files, it should be called "make install-config".)

By: Leif Madsen (lmadsen) 2010-04-15 12:49:26

Or it should at the very least warn you that files exist, and to prompt you to overwrite them. Or copy the existing files to something with a .bak extension.

By: Paul Belanger (pabelanger) 2010-04-15 13:49:42

The patch I previous provided did not change any existing functionality of asterisk.conf being created.  It just provided a method for you to only generate asterisk.conf.

Since talking with #asterisk-dev, I've created a new samples/asterisk.conf.sample file and change the process a little.  But, it will not change the existing functionality of overwriting and existing .conf file.

By: Digium Subversion (svnbot) 2010-05-04 19:22:32

Repository: asterisk
Revision: 261124

U   trunk/Makefile
A   trunk/configs/asterisk.conf.sample

r261124 | pabelanger | 2010-05-04 19:22:32 -0500 (Tue, 04 May 2010) | 14 lines

New static asterisk.conf.sample file.

This simply moves the functionality from the Makefile (cleaning it up) into an external
asterisk.conf.samples file.  Also updates formatting (easier to read) and grammar
changes to asterisk.conf.samples.

(closes issue ASTERISK-15809)
Reported by: pabelanger
     0017027.asterisk.conf.v6.patch uploaded by pabelanger (license 224)
Tested by: qwell, lmadsen, pabelanger, chappell

Review: https://reviewboard.asterisk.org/r/616/