Skip to content
Snippets Groups Projects
Commit 0d49cdae authored by Michiel van Baak's avatar Michiel van Baak
Browse files

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 #13062)
Reported by: mvanbaak
Patches:
      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.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@130578 65c4cc65-6c06-0410-ace0-fbb531ad65f3
parent 3cb49856
No related branches found
No related tags found
No related merge requests found
......@@ -9,5 +9,10 @@ make -C sounds MENUSELECT_CORE_SOUNDS=CORE-SOUNDS-EN-GSM MENUSELECT_MOH=MOH-FREE
make AWK=awk GREP=grep menuselect-tree
VERSION=`cat .version`
sed -i -e "s/ASTERISKVERSION/${VERSION}/" doc/tex/asterisk.tex
# make backup of asterisk.tex because we are going to alter it
cp asterisk.tex asterisk.tex.orig
sed -e "s/ASTERISKVERSION/${VERSION}/" doc/tex/asterisk.tex > doc/tex/asterisk_local.tex
mv asterisk_local.tex asterisk.tex
cd doc/tex && rubber --pdf asterisk.tex && latex2html asterisk.tex
# restore backup of asterisk.tex
mv asterisk.tex.orig asterisk.tex
......@@ -24,7 +24,8 @@ ifeq ($(findstring fncychap.sty,$(shell find `$(KPATHSEA) --expand-braces='$$(TE
endif
endif
@cp asterisk.tex asterisk.tex.orig
sed -i -e 's/ASTERISKVERSION/$(shell echo $(ASTERISKVERSION) | sed -e 's/\//\\\//g')/' asterisk.tex
@sed -e 's/ASTERISKVERSION/$(shell echo $(ASTERISKVERSION) | sed -e 's/\//\\\//g')/' asterisk.tex > asterisk_local.tex
@mv asterisk_local.tex asterisk.tex
@$(RUBBER) --pdf asterisk.tex
@mv asterisk.tex.orig asterisk.tex
endif
......@@ -38,7 +39,8 @@ html:
@echo "** required for this to work. ***"
@echo "**********************************************"
@cp asterisk.tex asterisk.tex.orig
@sed -i -e 's/ASTERISKVERSION/$(ASTERISKVERSION)/' asterisk.tex
@sed -e 's/ASTERISKVERSION/$(ASTERISKVERSION)/' asterisk.tex > asterisk_local.tex
@mv asterisk_local.tex asterisk.tex
@latex2html asterisk.tex
@mv asterisk.tex.orig asterisk.tex
......@@ -44,7 +44,7 @@ $(if $(filter res_snmp,$(EMBEDDED_MODS)),modules.link,res_snmp.so): snmp/agent.o
$(if $(filter res_ael_share,$(EMBEDDED_MODS)),modules.link,res_ael_share.so): ael/ael_lex.o ael/ael.tab.o ael/pval.o
ael/ael_lex.c:
(cd ael; flex ael.flex; sed -i -e "/begin standard C headers/i#include \"asterisk.h\"" ael_lex.c)
(cd ael; flex ael.flex; sed -e "/begin standard C headers/i#include \"asterisk.h\"" ael_lex.c > zz; mv zz ael_lex.c)
(cd ael; sed 's@#if __STDC_VERSION__ >= 199901L@#if !defined __STDC_VERSION__ || __STDC_VERSION__ >= 199901L@' ael_lex.c > zz; mv zz ael_lex.c)
ael/ael.tab.c ael/ael.tab.h:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment