summaryrefslogtreecommitdiffstats
path: root/coverity
diff options
context:
space:
mode:
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2016-09-27 01:59:12 +0200
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2016-09-27 02:10:22 +0200
commit681bd9ab8d87121c1363d9bab0ee6612623b548f (patch)
tree0936712dfc4095ece262acbf5d96f99841bef466 /coverity
parent895deec006b85fdc15869ff32ab66ffdc0609496 (diff)
coverity scripts: base all paths on initial $PWD
This allows having the coverity scripts in a different location than ~/coverity. In particular, this allows just cloning the osmo-ci anywhere, e.g. having ~/osmo-ci/coverity as the build location. Change-Id: I100cc763b06562dbeaea11c7175f3c92fc01117a
Diffstat (limited to 'coverity')
-rwxr-xr-xcoverity/build_iuh.sh23
-rwxr-xr-xcoverity/coverity_all.sh18
-rwxr-xr-xcoverity/coverity_iuh.sh15
-rwxr-xr-xcoverity/coverity_test_osmo_trx.sh11
4 files changed, 43 insertions, 24 deletions
diff --git a/coverity/build_iuh.sh b/coverity/build_iuh.sh
index 4e4f5f7..1374ebb 100755
--- a/coverity/build_iuh.sh
+++ b/coverity/build_iuh.sh
@@ -2,7 +2,13 @@
set -e -x
-export PKG_CONFIG_PATH=~/coverity/install-iuh/lib/pkgconfig
+base_dir="$PWD"
+src_dir="$base_dir/source-iuh"
+prefix="$base_dir/install-iuh"
+
+install -d "$prefix"
+
+export PKG_CONFIG_PATH="$prefix/lib/pkgconfig"
do_build() {
git clean -dxf
@@ -10,7 +16,7 @@ do_build() {
git remote prune origin
git pull --rebase
autoreconf --install --force
- ./configure --prefix=$HOME/coverity/install-iuh $*
+ ./configure --prefix="$prefix" $*
make
make install
@@ -18,8 +24,8 @@ do_build() {
build_layer1api() {
pushd layer1-api
- install -d $HOME/coverity/install-iuh/include/sysmocom/femtobts/
- cp include/*.h $HOME/coverity/install-iuh/include/sysmocom/femtobts/
+ install -d "$prefix/include/sysmocom/femtobts/"
+ cp include/*.h "$prefix/include/sysmocom/femtobts/"
popd
}
@@ -32,7 +38,7 @@ build_asn1c() {
build_libasn1c() {
pushd libasn1c
do_build
- sed -i s,'#include "config.h"','/*#include "config.h"*/', $HOME/coverity/install-iuh/include/asn1c/asn_system.h
+ sed -i s,'#include "config.h"','/*#include "config.h"*/', "$prefix/include/asn1c/asn_system.h"
popd
}
@@ -84,7 +90,7 @@ build_osmobts() {
popd
pushd osmo-bts
- do_build --enable-sysmocom-bts --with-openbsc=$PWD/../openbsc/openbsc/include
+ do_build --enable-sysmocom-bts --with-openbsc="$src_dir/openbsc/openbsc/include"
popd
}
@@ -125,10 +131,9 @@ build_osmosipconnector() {
popd
}
-cd source-iuh
-
+cd "$src_dir"
-rm -rf ~/coverity/install-iuh/
+rm -rf "$prefix"
build_layer1api
build_asn1c
diff --git a/coverity/coverity_all.sh b/coverity/coverity_all.sh
index 8dd8d49..fd5276c 100755
--- a/coverity/coverity_all.sh
+++ b/coverity/coverity_all.sh
@@ -1,18 +1,22 @@
#!/usr/bin/env bash
+set -e -x
+
base_dir="$PWD"
+src_dir="$base_dir/source"
+prefix="$base_dir/install"
-set -e -x
+install -d "$prefix"
-export PATH=~/coverity/cov-analysis-linux64-8.5.0/bin/:$PATH
-export PKG_CONFIG_PATH=~/coverity/install/lib/pkgconfig
+export PATH="$base_dir/cov-analysis-linux64-8.5.0/bin/:$PATH"
+export PKG_CONFIG_PATH="$prefix/lib/pkgconfig"
do_build() {
git clean -dxf
git remote prune origin
git pull --rebase
autoreconf --install --force
- ./configure --prefix=$HOME/coverity/install $*
+ ./configure --prefix="$prefix" $*
cov-build --dir cov-int make
make install
@@ -71,7 +75,7 @@ upload_openbsc() {
upload_osmobts() {
pushd osmo-bts
- do_build --enable-sysmocom-bts --with-openbsc=$PWD/../openbsc/openbsc/include
+ do_build --enable-sysmocom-bts --with-openbsc="$src_dir/openbsc/openbsc/include"
do_upload osmo-bts
popd
}
@@ -113,8 +117,8 @@ build_libsmpp34() {
build_api() {
pushd layer1-api
- install -d $HOME/coverity/install/include/sysmocom/femtobts/
- cp include/*.h $HOME/coverity/install/include/sysmocom/femtobts/
+ install -d "$prefix/include/sysmocom/femtobts/"
+ cp include/*.h "$prefix/include/sysmocom/femtobts/"
popd
}
diff --git a/coverity/coverity_iuh.sh b/coverity/coverity_iuh.sh
index 517b634..455bd92 100755
--- a/coverity/coverity_iuh.sh
+++ b/coverity/coverity_iuh.sh
@@ -2,15 +2,20 @@
set -e -x
-export PATH=~/coverity/cov-analysis-linux64-8.5.0/bin/:$PATH
+base_dir="$PWD"
+src_dir="$base_dir/sources-iuh"
+cov_dir="$src_dir/cov-int"
-rm -rf sources-iuh/cov-int
-cov-build --dir sources-iuh/cov-int ./build_iuh.sh
-cd sources-iuh
+export PATH="$base_dir/cov-analysis-linux64-8.5.0/bin/:$PATH"
+
+rm -rf "$cov_dir"
+cov-build --dir "$cov_dir" ./build_iuh.sh
+
+cd "$src_dir"
tar czf myproject.tgz cov-int
curl \
- --form token="$(../get_token.sh ../tokens.txt iuh)" \
+ --form token="$($base_dir/get_token.sh $base_dir/tokens.txt iuh)" \
--form email=holger@freyther.de --form file=@myproject.tgz \
--form version=Version --form description=AutoUpload \
https://scan.coverity.com/builds?project=Osmocom
diff --git a/coverity/coverity_test_osmo_trx.sh b/coverity/coverity_test_osmo_trx.sh
index 75da893..f4b382e 100755
--- a/coverity/coverity_test_osmo_trx.sh
+++ b/coverity/coverity_test_osmo_trx.sh
@@ -2,15 +2,20 @@
set -e -x
-export PATH=~/coverity/cov-analysis-linux64-8.5.0/bin/:$PATH
-export PKG_CONFIG_PATH=~/coverity/install/lib/pkgconfig
+base_dir="$PWD"
+prefix="$base_dir/install"
+
+install -d "$prefix"
+
+export PATH="$base_dir/cov-analysis-linux64-8.5.0/bin/:$PATH"
+export PKG_CONFIG_PATH="$prefix/lib/pkgconfig"
do_build() {
git clean -dxf
git remote prune origin
git pull --rebase
autoreconf --install --force
- ./configure --prefix=$HOME/coverity/install $*
+ ./configure --prefix="$prefix" $*
cov-build --dir cov-int make
make install