From 401038441ef6e979c0e146a8f6666852739d1fe9 Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Wed, 16 Mar 2016 21:39:26 +0100 Subject: [PATCH] migration: make script work with different workdir --- tool/migration_to_v1.0/migration.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tool/migration_to_v1.0/migration.sh b/tool/migration_to_v1.0/migration.sh index e42d3806d..507cf2e6f 100755 --- a/tool/migration_to_v1.0/migration.sh +++ b/tool/migration_to_v1.0/migration.sh @@ -2,7 +2,7 @@ set -e set -u -USAGE="Usage: conversion_to_1.0.sh src-path dest-path" +USAGE="Usage: migration.sh src-path dest-path" echo "BTstack conversion to v1.0 helper" echo "BlueKitchen GmbH, 2016" @@ -15,6 +15,7 @@ if [ $# -ne 2 ]; then fi SRC=$1 DEST=$2 +DIR=`dirname $0` echo "Creating copy of $SRC at $DEST" cp -r $SRC/ $DEST @@ -22,11 +23,11 @@ cp -r $SRC/ $DEST echo "Updating function calls" # simple function rename -find $DEST -type f -print0 | xargs -0 sed -i -f convert.sed +find $DEST -type f -print0 | xargs -0 sed -i -f $DIR/migration.sed # complext function rename using coccinelle command -v spatch >/dev/null 2>&1 || { echo >&2 "spatch from cocinelle required but not installed. Aborting."; exit 1; } -spatch --sp-file convert.cocci --in-place --dir $DEST > /dev/null # 2>&1 +spatch --sp-file $DIR/migration.cocci --in-place --dir $DEST > /dev/null # 2>&1 echo "Done. Good luck!"