[Home]

Summary:ASTERISK-13987: Problem in iLBC Source Fetch Script on FreeBSD
Reporter:Leo Brown (netfuse)Labels:
Date Opened:2009-04-20 06:47:02Date Closed:2009-04-22 09:34:00
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Codecs/codec_ilbc
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) 2009042200_14936.diff.txt
( 1) 2009042201_14936.diff.txt
Description:As of Asterisk 1.6.0.1 (the furthest back i've tried), the ilbc source fetch script is broken on FreeBSD (does not strip out RFC headers/comments). Removing the 'sed' line that is supposed to remove \r allows source to be compiled without hitch.

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

./contrib/scripts/get_ilbc_source.sh
Comments:By: Leif Madsen (lmadsen) 2009-04-21 21:47:32

I've assigned this to mvanbaak to take a quick look at this issue to see if he has an idea of how to resolve this. Thanks!

By: Leo Brown (netfuse) 2009-04-22 02:35:51

TBH We have a bit of an ongoing problem here anyway. Last night ilbcfreeware.org was down, and so compilation of the source was impossible. Is there a plan for a better approach to this?

By: Michiel van Baak (mvanbaak) 2009-04-22 03:16:48

lmadsen: leobrown is correct.
I too wonder why this sed call is there.

Attached patch to fix this problem. Tested on ubuntu and OpenBSD and works without problem.

By: Michiel van Baak (mvanbaak) 2009-04-22 03:17:40

leobrown, Can you test attached patch and tell me if it's working for you.

By: Leo Brown (netfuse) 2009-04-22 03:27:05

Works great, thanks!

By: Michiel van Baak (mvanbaak) 2009-04-22 03:43:36

Thanks. I did find why the awk was added though.
Have a look at bug ASTERISK-12105

By: Leo Brown (netfuse) 2009-04-22 04:20:51

Right well this is a POSIX/Win32 linebreak issue, hence the removal of \r (0x0D) windows 'carriage return'.

The problem here is that \r isn't recognised by sed on BSD as an escape character.

Unix2dos/dos2unix utilities are designed to manage this but aren't core on many nix implementations.

However.. `tr` I believe is deployed on all installations. The syntax is:

 wget -q -O - http://www.ilbcfreeware.org/documentation/extract-cfile.awk | tr -d '\r'

What do you think?

By: Michiel van Baak (mvanbaak) 2009-04-22 06:46:40

Great. Thanks for following up

New patch attached.

I checked Ubuntu 8.10, Debian etch, OpenBSD 4.4 and OpenBSD 4.5 and they all have tr by default and tr -d '\r' is working on all of them.

By: Digium Subversion (svnbot) 2009-04-22 09:29:31

Repository: asterisk
Revision: 189849

U   branches/1.4/contrib/scripts/get_ilbc_source.sh

------------------------------------------------------------------------
r189849 | mvanbaak | 2009-04-22 09:29:30 -0500 (Wed, 22 Apr 2009) | 12 lines

replace sed with tr to remove \r from downloaded file

On some systems, sed does not recognize \r in the pattern the way it
was used here.
Use tr instead because this works the same across systems.

(closes issue ASTERISK-13987)
Reported by: leobrown
Patches:
     2009042201_14936.diff.txt uploaded by mvanbaak (license 7)
 Tested by: leobrown, mvanbaak

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

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

By: Digium Subversion (svnbot) 2009-04-22 09:30:48

Repository: asterisk
Revision: 189850

_U  trunk/
U   trunk/contrib/scripts/get_ilbc_source.sh

------------------------------------------------------------------------
r189850 | mvanbaak | 2009-04-22 09:30:48 -0500 (Wed, 22 Apr 2009) | 19 lines

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

........
 r189849 | mvanbaak | 2009-04-22 16:29:28 +0200 (Wed, 22 Apr 2009) | 12 lines
 
 replace sed with tr to remove \r from downloaded file
 
 On some systems, sed does not recognize \r in the pattern the way it
 was used here.
 Use tr instead because this works the same across systems.
 
 (closes issue ASTERISK-13987)
 Reported by: leobrown
 Patches:
       2009042201_14936.diff.txt uploaded by mvanbaak (license 7)
   Tested by: leobrown, mvanbaak
........

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

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

By: Digium Subversion (svnbot) 2009-04-22 09:32:44

Repository: asterisk
Revision: 189851

_U  branches/1.6.0/
U   branches/1.6.0/contrib/scripts/get_ilbc_source.sh

------------------------------------------------------------------------
r189851 | mvanbaak | 2009-04-22 09:32:44 -0500 (Wed, 22 Apr 2009) | 26 lines

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

................
 r189850 | mvanbaak | 2009-04-22 16:30:47 +0200 (Wed, 22 Apr 2009) | 19 lines
 
 Merged revisions 189849 via svnmerge from
 https://origsvn.digium.com/svn/asterisk/branches/1.4
 
 ........
   r189849 | mvanbaak | 2009-04-22 16:29:28 +0200 (Wed, 22 Apr 2009) | 12 lines
   
   replace sed with tr to remove \r from downloaded file
   
   On some systems, sed does not recognize \r in the pattern the way it
   was used here.
   Use tr instead because this works the same across systems.
   
   (closes issue ASTERISK-13987)
   Reported by: leobrown
   Patches:
         2009042201_14936.diff.txt uploaded by mvanbaak (license 7)
     Tested by: leobrown, mvanbaak
 ........
................

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

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

By: Digium Subversion (svnbot) 2009-04-22 09:33:59

Repository: asterisk
Revision: 189852

_U  branches/1.6.1/
U   branches/1.6.1/contrib/scripts/get_ilbc_source.sh

------------------------------------------------------------------------
r189852 | mvanbaak | 2009-04-22 09:33:59 -0500 (Wed, 22 Apr 2009) | 26 lines

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

................
 r189850 | mvanbaak | 2009-04-22 16:30:47 +0200 (Wed, 22 Apr 2009) | 19 lines
 
 Merged revisions 189849 via svnmerge from
 https://origsvn.digium.com/svn/asterisk/branches/1.4
 
 ........
   r189849 | mvanbaak | 2009-04-22 16:29:28 +0200 (Wed, 22 Apr 2009) | 12 lines
   
   replace sed with tr to remove \r from downloaded file
   
   On some systems, sed does not recognize \r in the pattern the way it
   was used here.
   Use tr instead because this works the same across systems.
   
   (closes issue ASTERISK-13987)
   Reported by: leobrown
   Patches:
         2009042201_14936.diff.txt uploaded by mvanbaak (license 7)
     Tested by: leobrown, mvanbaak
 ........
................

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

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