summaryrefslogtreecommitdiffstats
path: root/sca-cpp/trunk/components/log
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--sca-cpp/trunk/components/log/Makefile.am18
-rw-r--r--sca-cpp/trunk/components/log/scribe-cat.cpp2
-rwxr-xr-xsca-cpp/trunk/components/log/scribe-tail-start4
-rwxr-xr-xsca-cpp/trunk/components/log/scribe-tail-stop4
-rwxr-xr-xsca-cpp/trunk/components/log/scribe-test2
-rwxr-xr-xsca-cpp/trunk/components/log/scribed-central-conf4
-rwxr-xr-xsca-cpp/trunk/components/log/scribed-central-start4
-rwxr-xr-xsca-cpp/trunk/components/log/scribed-central-stop4
-rwxr-xr-xsca-cpp/trunk/components/log/scribed-client-conf4
-rwxr-xr-xsca-cpp/trunk/components/log/scribed-client-start4
-rwxr-xr-xsca-cpp/trunk/components/log/scribed-client-stop4
-rwxr-xr-xsca-cpp/trunk/components/log/server-test2
-rwxr-xr-xsca-cpp/trunk/components/log/thrift-pragmas32
13 files changed, 60 insertions, 28 deletions
diff --git a/sca-cpp/trunk/components/log/Makefile.am b/sca-cpp/trunk/components/log/Makefile.am
index 88ff7b3001..92be162101 100644
--- a/sca-cpp/trunk/components/log/Makefile.am
+++ b/sca-cpp/trunk/components/log/Makefile.am
@@ -36,31 +36,31 @@ EXTRA_DIST = log.composite log.componentType logger.componentType *.scm *.thrift
BUILT_SOURCES=gen-cpp/fb303_constants.cpp gen-cpp/fb303_types.cpp gen-cpp/scribe_constants.cpp gen-cpp/scribe.cpp gen-cpp/scribe_types.cpp gen-cpp/FacebookService.cpp gen-cpp/scribe.h
gen-cpp/fb303_constants.cpp gen-cpp/fb303_types.cpp gen-cpp/scribe_constants.cpp gen-cpp/scribe.cpp gen-cpp/scribe_types.cpp gen-cpp/FacebookService.cpp gen-cpp/scribe.h: scribe.thrift
- ${THRIFT_PREFIX}/bin/thrift -r --gen cpp scribe.thrift; sed -i -e '1i#pragma GCC diagnostic ignored "-Wconversion"\n#pragma GCC diagnostic ignored "-Wunused"\n' gen-cpp/*.cpp
+ ${THRIFT_PREFIX}/bin/thrift -r --gen cpp scribe.thrift; (ls gen-cpp/*.cpp gen-cpp/*.h | xargs -I {} -t ./thrift-pragmas {})
CLEANFILES = gen-cpp/*
comp_LTLIBRARIES = liblog.la liblogger.la
-noinst_DATA = liblog.so liblogger.so
+noinst_DATA = liblog${libsuffix} liblogger${libsuffix}
nodist_liblog_la_SOURCES = gen-cpp/fb303_constants.cpp gen-cpp/fb303_types.cpp gen-cpp/scribe_constants.cpp gen-cpp/scribe.cpp gen-cpp/scribe_types.cpp gen-cpp/FacebookService.cpp gen-cpp/scribe.h
-liblog_la_CXXFLAGS = -Wno-unused-parameter -Wno-conversion
+liblog_la_CXXFLAGS = -Wno-unused-parameter -Wno-conversion -Wno-return-type
liblog_la_SOURCES = log.cpp
liblog_la_LDFLAGS = -L${THRIFT_LIB} -R${THRIFT_LIB} -lthrift -L${FB303_LIB} -R${FB303_LIB} -lfb303 -L${SCRIBE_LIB} -R${SCRIBE_LIB} -lscribe
-liblog.so:
- ln -s .libs/liblog.so
+liblog${libsuffix}:
+ ln -s .libs/liblog${libsuffix}
nodist_liblogger_la_SOURCES = gen-cpp/fb303_constants.cpp gen-cpp/fb303_types.cpp gen-cpp/scribe_constants.cpp gen-cpp/scribe.cpp gen-cpp/scribe_types.cpp gen-cpp/FacebookService.cpp gen-cpp/scribe.h
-liblogger_la_CXXFLAGS = -Wno-unused-parameter -Wno-conversion
+liblogger_la_CXXFLAGS = -Wno-unused-parameter -Wno-conversion -Wno-return-type
liblogger_la_SOURCES = logger.cpp
liblogger_la_LDFLAGS = -L${THRIFT_LIB} -R${THRIFT_LIB} -lthrift -L${FB303_LIB} -R${FB303_LIB} -lfb303 -L${SCRIBE_LIB} -R${SCRIBE_LIB} -lscribe
-liblogger.so:
- ln -s .libs/liblogger.so
+liblogger${libsuffix}:
+ ln -s .libs/liblogger${libsuffix}
comp_PROGRAMS = scribe-cat
nodist_scribe_cat_SOURCES = gen-cpp/fb303_constants.cpp gen-cpp/fb303_types.cpp gen-cpp/scribe_constants.cpp gen-cpp/scribe.cpp gen-cpp/scribe_types.cpp gen-cpp/FacebookService.cpp gen-cpp/scribe.h
-scribe_cat_CXXFLAGS = -Wno-unused-parameter -Wno-conversion
+scribe_cat_CXXFLAGS = -Wno-unused-parameter -Wno-conversion -Wno-return-type
scribe_cat_SOURCES = scribe-cat.cpp
scribe_cat_LDFLAGS = -L${THRIFT_LIB} -R${THRIFT_LIB} -lthrift -L${FB303_LIB} -R${FB303_LIB} -lfb303 -L${SCRIBE_LIB} -R${SCRIBE_LIB} -lscribe
diff --git a/sca-cpp/trunk/components/log/scribe-cat.cpp b/sca-cpp/trunk/components/log/scribe-cat.cpp
index f3c5e898cd..77011e8b12 100644
--- a/sca-cpp/trunk/components/log/scribe-cat.cpp
+++ b/sca-cpp/trunk/components/log/scribe-cat.cpp
@@ -46,7 +46,7 @@ int cat(const string& category, const string& type) {
const char* s = fgets(buf, 8192, stdin);
if (s == NULL)
return 0;
- const int l = strlen(s);
+ const size_t l = strlen(s);
if (l < 2)
return 0;
buf[l - 1] = '\0';
diff --git a/sca-cpp/trunk/components/log/scribe-tail-start b/sca-cpp/trunk/components/log/scribe-tail-start
index 0044f1620d..22f5101053 100755
--- a/sca-cpp/trunk/components/log/scribe-tail-start
+++ b/sca-cpp/trunk/components/log/scribe-tail-start
@@ -18,7 +18,7 @@
# under the License.
# Tail a file and pipe into scribe-cat
-here=`readlink -f $0`; here=`dirname $here`
+here=`echo "import os; print os.path.realpath('$0')" | python`; here=`dirname $here`
category=""
type=""
@@ -38,7 +38,7 @@ fi
mkdir -p `dirname $file`
touch $file
-file=`readlink -f $file`
+file=`echo "import os; print os.path.realpath('$file')" | python`
tail -f -n 0 $file | $here/scribe-cat $category $type &
diff --git a/sca-cpp/trunk/components/log/scribe-tail-stop b/sca-cpp/trunk/components/log/scribe-tail-stop
index e1b74fc0c6..b46c1ecca6 100755
--- a/sca-cpp/trunk/components/log/scribe-tail-stop
+++ b/sca-cpp/trunk/components/log/scribe-tail-stop
@@ -18,7 +18,7 @@
# under the License.
# Stop tailing a file
-here=`readlink -f $0`; here=`dirname $here`
+here=`echo "import os; print os.path.realpath('$0')" | python`; here=`dirname $here`
category=""
type=""
@@ -35,7 +35,7 @@ else
file=$1
fi
fi
-file=`readlink -f $file`
+file=`echo "import os; print os.path.realpath('$file')" | python`
cmd="tail -f -n 0 $file"
kill `ps -ef | grep -v grep | grep "${cmd}" | awk '{ print $2 }'`
diff --git a/sca-cpp/trunk/components/log/scribe-test b/sca-cpp/trunk/components/log/scribe-test
index a355026dd0..bc34f6f650 100755
--- a/sca-cpp/trunk/components/log/scribe-test
+++ b/sca-cpp/trunk/components/log/scribe-test
@@ -40,4 +40,4 @@ sleep 1
if [ "$rc" = "0" ]; then
echo "OK"
fi
-return $rc
+exit $rc
diff --git a/sca-cpp/trunk/components/log/scribed-central-conf b/sca-cpp/trunk/components/log/scribed-central-conf
index b23646c24f..d8d008623d 100755
--- a/sca-cpp/trunk/components/log/scribed-central-conf
+++ b/sca-cpp/trunk/components/log/scribed-central-conf
@@ -18,9 +18,9 @@
# under the License.
# Generate a Scribe central conf
-here=`readlink -f $0`; here=`dirname $here`
+here=`echo "import os; print os.path.realpath('$0')" | python`; here=`dirname $here`
mkdir -p $1
-root=`readlink -f $1`
+root=`echo "import os; print os.path.realpath('$1')" | python`
port=$2
if [ "$port" = "" ]; then
diff --git a/sca-cpp/trunk/components/log/scribed-central-start b/sca-cpp/trunk/components/log/scribed-central-start
index c2035037de..9aff8a1466 100755
--- a/sca-cpp/trunk/components/log/scribed-central-start
+++ b/sca-cpp/trunk/components/log/scribed-central-start
@@ -18,8 +18,8 @@
# under the License.
# Start central scribed
-here=`readlink -f $0`; here=`dirname $here`
-root=`readlink -f $1`
+here=`echo "import os; print os.path.realpath('$0')" | python`; here=`dirname $here`
+root=`echo "import os; print os.path.realpath('$1')" | python`
scribe_prefix=`cat $here/scribe.prefix`
thrift_prefix=`cat $here/thrift.prefix`
diff --git a/sca-cpp/trunk/components/log/scribed-central-stop b/sca-cpp/trunk/components/log/scribed-central-stop
index 95a976813f..acded2a482 100755
--- a/sca-cpp/trunk/components/log/scribed-central-stop
+++ b/sca-cpp/trunk/components/log/scribed-central-stop
@@ -18,8 +18,8 @@
# under the License.
# Stop central scribed
-here=`readlink -f $0`; here=`dirname $here`
-root=`readlink -f $1`
+here=`echo "import os; print os.path.realpath('$0')" | python`; here=`dirname $here`
+root=`echo "import os; print os.path.realpath('$1')" | python`
scribe_prefix=`cat $here/scribe.prefix`
thrift_prefix=`cat $here/thrift.prefix`
diff --git a/sca-cpp/trunk/components/log/scribed-client-conf b/sca-cpp/trunk/components/log/scribed-client-conf
index 87c8749c2e..8395b3f96e 100755
--- a/sca-cpp/trunk/components/log/scribed-client-conf
+++ b/sca-cpp/trunk/components/log/scribed-client-conf
@@ -18,9 +18,9 @@
# under the License.
# Generate a Scribe client conf
-here=`readlink -f $0`; here=`dirname $here`
+here=`echo "import os; print os.path.realpath('$0')" | python`; here=`dirname $here`
mkdir -p $1
-root=`readlink -f $1`
+root=`echo "import os; print os.path.realpath('$1')" | python`
central=$2
cport=$3
diff --git a/sca-cpp/trunk/components/log/scribed-client-start b/sca-cpp/trunk/components/log/scribed-client-start
index ed8636d7f2..acf52c535f 100755
--- a/sca-cpp/trunk/components/log/scribed-client-start
+++ b/sca-cpp/trunk/components/log/scribed-client-start
@@ -18,8 +18,8 @@
# under the License.
# Start client scribed
-here=`readlink -f $0`; here=`dirname $here`
-root=`readlink -f $1`
+here=`echo "import os; print os.path.realpath('$0')" | python`; here=`dirname $here`
+root=`echo "import os; print os.path.realpath('$1')" | python`
scribe_prefix=`cat $here/scribe.prefix`
thrift_prefix=`cat $here/thrift.prefix`
diff --git a/sca-cpp/trunk/components/log/scribed-client-stop b/sca-cpp/trunk/components/log/scribed-client-stop
index 2e8959fbfc..0f9c409183 100755
--- a/sca-cpp/trunk/components/log/scribed-client-stop
+++ b/sca-cpp/trunk/components/log/scribed-client-stop
@@ -18,8 +18,8 @@
# under the License.
# Stop client scribed
-here=`readlink -f $0`; here=`dirname $here`
-root=`readlink -f $1`
+here=`echo "import os; print os.path.realpath('$0')" | python`; here=`dirname $here`
+root=`echo "import os; print os.path.realpath('$1')" | python`
scribe_prefix=`cat $here/scribe.prefix`
thrift_prefix=`cat $here/thrift.prefix`
diff --git a/sca-cpp/trunk/components/log/server-test b/sca-cpp/trunk/components/log/server-test
index 631487c77a..e8e13f9d31 100755
--- a/sca-cpp/trunk/components/log/server-test
+++ b/sca-cpp/trunk/components/log/server-test
@@ -62,4 +62,4 @@ sleep 1
if [ "$rc" = "0" ]; then
echo "OK"
fi
-return $rc
+exit $rc
diff --git a/sca-cpp/trunk/components/log/thrift-pragmas b/sca-cpp/trunk/components/log/thrift-pragmas
new file mode 100755
index 0000000000..3950ce9984
--- /dev/null
+++ b/sca-cpp/trunk/components/log/thrift-pragmas
@@ -0,0 +1,32 @@
+#!/bin/sh
+
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+# Patch generated Thrift files, disable some compile warnings
+
+tmpfile=`mktemp -t thrift-pragmas.XXX`
+cat >$tmpfile << EOF
+#pragma GCC diagnostic ignored "-Wconversion"
+#pragma GCC diagnostic ignored "-Wunused"
+#pragma GCC diagnostic ignored "-Wreturn-type"
+EOF
+
+cat $1 >>$tmpfile
+cat $tmpfile >$1
+
+rm $tmpfile