Skip to content

Commit

Permalink
ATS revert: Lexicon first pass.
Browse files Browse the repository at this point in the history
  • Loading branch information
SolidWallOfCode committed Oct 24, 2018
1 parent c792de6 commit efe1f25
Showing 1 changed file with 30 additions and 2 deletions.
32 changes: 30 additions & 2 deletions tools/ats-revert.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
# Need to run this in the libswoc directory.
ATS=../work
ATS=../ats

function rewrite {
sed -i -E --expr 's!swoc/swoc_meta!tscpp/util/ts_meta!g' $1
Expand All @@ -11,8 +11,36 @@ function rewrite {
sed -i -E --expr 's!namespace swoc!namespace ts!g' $1
sed -i -E --expr 's!ts/swoc_meta!tscpp/util/ts_meta!g' $1
sed -i -E --expr 's!swoc_meta!ts_meta!g' $1
sed -i -E --expr 's![[]libswoc[]]![libtscpputil]!' $1
}

### Lexicon

if cp include/swoc/Lexicon.h ${ATS}/include/tscpp/util ; then
rewrite ${ATS}/include/tscpp/util/Lexicon.h
(cd ${ATS};git add include/tscpp/util/Lexicon.h)
else
echo "Failed to copy Lexicon.h"
exit 1;
fi

if [ -f ${ATS}/src/tscore/unit_tests/test_Lexicon.cc ] ; then
(cd ${ATS}; git mv src/tscore/unit_tests/test_Lexicon.cc src/tscpp/util/unit_tests)
fi

if cp src/unit_tests/test_Lexicon.cc ${ATS}/src/tscpp/util/unit_tests ; then
rewrite ${ATS}/src/tscpp/util/unit_tests/test_Lexicon.cc
if ! grep -q test_Lexicon[.]cc ${ATS}/src/tscpp/util/Makefile.am ; then
sed -i -E --expr '\!test_MemArena.cc!i\
\tunit_tests/test_Lexicon.cc \\' ${ATS}/src/tscpp/util/Makefile.am
fi
if ! grep -q Lexicon[.]h ${ATS}/include/tscpp/util/Makefile.am ; then
sed -i -E --expr '\!MemArena!i\
\tLexicon.h \\' ${ATS}/include/tscpp/util/Makefile.am
fi
fi
exit 0

# Scalar
if [ -f ${ATS}/include/tscore/Scalar.h ] ; then
(cd ${ATS}; git mv include/tscore/Scalar.h include/tscpp/util)
Expand Down Expand Up @@ -409,14 +437,14 @@ fi

if cp src/MemArena.cc ${ATS}/src/tscpp/util ; then
rewrite ${ATS}/src/tscpp/util/MemArena.cc
sed -i -E --expr 's!tscpp/util/Scalar[.]h!tscore/Scalar.h!g' ${ATS}src/tscpp/util/MemArena.cc
else
echo "Failed to copy test_MemArena.cc"
exit 1;
fi

if cp src/unit_tests/test_MemArena.cc ${ATS}/src/tscpp/util/unit_tests/test_MemArena.cc ; then
rewrite ${ATS}/src/tscpp/util/unit_tests/test_MemArena.cc
sed -i -E --expr 's!tscpp/util/Scalar[.]h!tscore/Scalar.h!g' ${ATS}src/tscpp/util/MemArena.cc
sed -i -E --expr 'MemArena[.]cc/d' ${ATS}/src/tscore/Makefile.am
if ! grep -q \\sMemArena[.]cc ${ATS}/src/tscpp/util/Makefile.am ; then
sed -i -E --expr '\!PostScript[.]h!i\
Expand Down

0 comments on commit efe1f25

Please sign in to comment.