Summary:ASTERISK-12368: [patch] doc/tex/Makefile uses non-portable -i flag for sed
Reporter:Michiel van Baak (mvanbaak)Labels:
Date Opened:2008-07-12 09:06:21Date Closed:2008-07-13 18:06:37
Versions:Frequency of
Environment:Attachments:( 0) doc-Makefile.diff
( 1) doc-Makefile-v2.diff
( 2) sed_without-i.diff
( 3) sed_without-i-v2.diff
( 4) sed_without-i-v3.diff
Description:While trying to generate the HTML docs from the tex source I ran into the problem that the sed calls in doc/tex/Makefile use the -i flag.
This flag is not present on every system.

Besides that, the sed calls are useless because it tries to replace ASTERISKVERSION and that string does not appear in any tex file.

This patch simply removes these calls and the surrounding cp/mv calls to restore the original asterisk.tex

Now it works great on both my linux and OpenBSD boxen.
Comments:By: Michiel van Baak (mvanbaak) 2008-07-12 20:25:10

instead of removing the whole sed call, make the sed call posix compatible.

sed -e 's/something/anotherthing/' asterisk.tex > asteriskzzz.tex
mv asteriskzzz.tex asterisk.tex

That's the way to go.

Thanks to seanbright for his input on IRC #asterisk-dev

By: Michiel van Baak (mvanbaak) 2008-07-13 09:29:43

Another patch, this time addresses all uses of sed -i

By: Michiel van Baak (mvanbaak) 2008-07-13 09:46:05

new patch that does not alter the svn managed files, but uses an intermediate file

Based on feedback from Corydon on #asterisk-dev

By: Michiel van Baak (mvanbaak) 2008-07-13 10:07:13

After testing I found out the intemediate file way was not nice.
It would create a directory called after the intermediate file.

Now we do the same as the doc/tex/Makefile version did before:
Create a local backup of the original asterisk.tex file that will be restored after the documentation is generated.

By: Digium Subversion (svnbot) 2008-07-13 18:06:34

Repository: asterisk
Revision: 130578

U   trunk/build_tools/prep_tarball
U   trunk/doc/tex/Makefile
U   trunk/res/Makefile

r130578 | mvanbaak | 2008-07-13 18:06:29 -0500 (Sun, 13 Jul 2008) | 15 lines

Make all sed calls Posix sed compatible.
To make sure nobody commits script-modified files we first make a backup
of asterisk.tex, run the script, generate the pdf and / or html,
and put the original asterisk.tex back.
This will guard us for the stuff that happened before that someone committed
a locally modified asterisk.tex, with changes done by this script.

(closes issue ASTERISK-12368)
Reported by: mvanbaak
     sed_without-i-v3.diff uploaded by mvanbaak (license 7)
Tested by: mvanbaak

Feedback from Corydon. Thanks for taking the time to go through this.