mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-05 13:28:03 +02:00
Convert bash scripts to regular sh ones for greater portability
This commit is contained in:
parent
0d932f43fe
commit
e6166f7b44
3 changed files with 25 additions and 24 deletions
|
|
@ -1,8 +1,8 @@
|
|||
#!/bin/bash
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
usage() {
|
||||
argv0=$(basename $0)
|
||||
argv0=`basename $0`
|
||||
|
||||
cat >&2 << END
|
||||
Usage:
|
||||
|
|
@ -61,7 +61,7 @@ done
|
|||
|
||||
# Then if anything is left that still looks like an option, (begins
|
||||
# with a dash), give usage to catch --help or any other -garbage
|
||||
if [ $# -eq 0 ] || [ "${1#-}" != "$1" ]; then
|
||||
if [ $# -eq 0 ] || [ "`echo "$1" | sed 's/^-//'`" != "$1" ]; then
|
||||
usage
|
||||
fi
|
||||
|
||||
|
|
@ -90,9 +90,9 @@ fi
|
|||
git_setup() {
|
||||
SUBDIRECTORY_OK='Yes'
|
||||
. git-sh-setup
|
||||
CAIRO_DIR=$(dirname $GIT_DIR)
|
||||
CAIRO_DIR=`dirname $GIT_DIR`
|
||||
if [ "$CAIRO_DIR" = "." ]; then
|
||||
CAIRO_DIR=$(pwd)
|
||||
CAIRO_DIR=`pwd`
|
||||
fi
|
||||
CAIRO_PERF_DIR=$CAIRO_DIR/.perf
|
||||
}
|
||||
|
|
@ -121,8 +121,8 @@ cpu_count() {
|
|||
# results from a run with an equivalent src tree.
|
||||
rev2perf() {
|
||||
rev=$1
|
||||
src_tree_sha=$(rev2sha $rev:src)
|
||||
perf_tree_sha=$(rev2sha HEAD:perf)
|
||||
src_tree_sha=`rev2sha $rev:src`
|
||||
perf_tree_sha=`rev2sha HEAD:perf`
|
||||
echo "$CAIRO_PERF_DIR/${perf_tree_sha}-${src_tree_sha}.perf"
|
||||
}
|
||||
|
||||
|
|
@ -135,9 +135,9 @@ run_cairo_perf_if_not_cached() {
|
|||
rev=$1
|
||||
build_dir="build-$2"
|
||||
|
||||
owd=$(pwd)
|
||||
sha=$(rev2sha $rev)
|
||||
perf=$(rev2perf $rev)
|
||||
owd=`pwd`
|
||||
sha=`rev2sha $rev`
|
||||
perf=`rev2perf $rev`
|
||||
if [ -e $perf ] && [ "$force_cairo_perf" != "true" ]; then
|
||||
return 0
|
||||
fi
|
||||
|
|
@ -147,8 +147,8 @@ run_cairo_perf_if_not_cached() {
|
|||
fi
|
||||
|
||||
cd $CAIRO_DIR
|
||||
boilerplate_files=$(git ls-tree --name-only HEAD boilerplate/*)
|
||||
perf_files=$(git ls-tree --name-only HEAD perf/*)
|
||||
boilerplate_files=`git ls-tree --name-only HEAD boilerplate/*`
|
||||
perf_files=`git ls-tree --name-only HEAD perf/*`
|
||||
cd $CAIRO_PERF_DIR
|
||||
|
||||
if [ ! -d $build_dir ]; then
|
||||
|
|
@ -161,7 +161,8 @@ run_cairo_perf_if_not_cached() {
|
|||
git reset --hard $sha
|
||||
|
||||
if [ -z "$MAKEFLAGS" ]; then
|
||||
export MAKEFLAGS="-j$(expr $(cpu_count) + 1)"
|
||||
CPU_COUNT=`cpu_count`
|
||||
export MAKEFLAGS="-j`expr $CPU_COUNT + 1`"
|
||||
fi
|
||||
|
||||
if [ ! -e Makefile ]; then
|
||||
|
|
@ -193,12 +194,12 @@ fi
|
|||
|
||||
if [ ! -e $old ]; then
|
||||
run_cairo_perf_if_not_cached $old old
|
||||
old=$(rev2perf $old)
|
||||
old=`rev2perf $old`
|
||||
fi
|
||||
|
||||
if [ ! -e $new ]; then
|
||||
run_cairo_perf_if_not_cached $new new
|
||||
new=$(rev2perf $new)
|
||||
new=`rev2perf $new`
|
||||
fi
|
||||
|
||||
if [ "$html_output" != "true" ]; then
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#!/bin/bash
|
||||
#!/bin/sh
|
||||
|
||||
LANG=C
|
||||
|
||||
|
|
@ -18,19 +18,19 @@ fi
|
|||
defs="cairo.def"
|
||||
make $defs
|
||||
for def in $defs; do
|
||||
lib=${def%.def}
|
||||
lib=${lib##*/}
|
||||
lib=`echo "$def" | sed 's/[.]def$//'`
|
||||
lib=`echo "$lib" | sed 's@.*/@@'`
|
||||
so=.libs/lib${lib}.so
|
||||
|
||||
test -f $so || continue
|
||||
test -f "$so" || continue
|
||||
echo Checking $def
|
||||
|
||||
{
|
||||
echo EXPORTS
|
||||
eval $get_cairo_syms | grep -v '^_cairo_test_\|^_fini\|^_init' | sort -u
|
||||
# cheat: copy the last line from the def file!
|
||||
tail -n1 $def
|
||||
} | diff $def - || status=1
|
||||
tail -n1 "$def"
|
||||
} | diff "$def" - || status=1
|
||||
done
|
||||
|
||||
exit $status
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#!/bin/bash
|
||||
#!/bin/sh
|
||||
|
||||
LANG=C
|
||||
|
||||
|
|
@ -10,8 +10,8 @@ if ! which readelf 2>/dev/null >/dev/null; then
|
|||
fi
|
||||
|
||||
for so in .libs/lib*.so; do
|
||||
echo Checking $so for local PLT entries
|
||||
readelf -W -r $so | grep 'JU\?MP_SLO' | grep 'cairo' && status=1
|
||||
echo Checking "$so" for local PLT entries
|
||||
readelf -W -r "$so" | grep 'JU\?MP_SLO' | grep 'cairo' && status=1
|
||||
done
|
||||
|
||||
exit $status
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue