asterisk-core-sounds - extra sound files of asterisk

Jonas Smedegaard dr at
Sun Mar 21 10:04:24 UTC 2010

On Sun, Mar 21, 2010 at 07:00:01AM +0200, Tzafrir Cohen wrote:
>On Sun, Mar 21, 2010 at 03:16:33AM +0100, Jonas Smedegaard wrote:
>> On Sat, Mar 20, 2010 at 11:55:50PM +0200, Tzafrir Cohen wrote:

>>> Look at 
>>> Please explain how packages from it could be used with 
>>> update-alternatives .
>>> This package builds 9 different binary packages:
>>>  asterisk-core-sounds-{en,es,fr}-{g722,gsm,wav}
>>> All three asterisk-core-sounds-en-* packages install files to the 
>>> same directory. They install the same files with a different 
>>> extension. Thus they are not mutually exlcusive. And thus each of 
>>> them makes that directory a sane candidate for the symlink 
>>> /usr/share/asterisk/sounds/en . (The same applies to the two other 
>>> languages).
>>> Thus I can't simply run 'update-alternatives --install' in the 
>>> postinst and 'update-alternatives --remove' in the prerm. I should 
>>> only add it if it was not already added (easy: just check) and 
>>> remove it only if nobody uses it (that's the difficult part).
>>> I can't think of a simple and robust definition of "nobody's using 
>>> it". Something that comes close i to keep an independent registry of 
>>> some sort of all the candidate packages. Another way is to look for 
>>> some specific file in the directory. But this means I have to run 
>>> things in the postrm. Furthermore I don't like that hueristic.
>> Ah, I understand the issue now, I believe.  Yes, update-alternatives 
>> handle alternatives between "atomic" objects.  So the solution is 
>> simple as I see it:
>> Just ship the various sound formats together.  I see no problem then:
>>   asterisk-core-sounds-{en,es,fr} (each containing g722, gsm and wav)
>I do.
>7.7M asterisk-core-sounds-en-g722_1.4.17-1_all.deb
>1.8M asterisk-core-sounds-en-gsm_1.4.17-1_all.deb
> 15M asterisk-core-sounds-en-wav_1.4.17-1_all.deb

No you don't.  You ship packages containing g722, gsm *or* wav.

This is what I suggested:

24.5M asterisk-core-sounds-en_1.4.17-1_all.deb

...but read below for a better suggestion.

>Sometimes it makes sense to have just the gsm ones. In fact, in many 
>cases (this is what I'll probably do inthe next live CD. This is the 
>current default).

Ah, ok.  Then ship it like this:

   Depends: asterisk-core-sounds-en-gsm
   Provides: asterisk-sounds-en, asterisk-sounds-en-us

   Register-alternatives: /usr/share/asterisk/sounds/en,
   Recommends: asterisk-core-sounds-en-g722,
   Provides: asterisk-sounds-en, asterisk-sounds-en-us

   Depends: asterisk-core-sounds-en-gsm
   Provides: asterisk-sounds-en, asterisk-sounds-en-us

Makes sense?

Kind regards,

  - Jonas

* Jonas Smedegaard - idealist & Internet-arkitekt
* Tlf.: +45 40843136  Website:

  [x] quote me freely  [ ] ask before reusing  [ ] keep private
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <>

More information about the Pkg-voip-maintainers mailing list