From c1597ec775eac659e43af58bad33972d404cb97f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Narajowski?= Date: Thu, 28 May 2020 11:58:56 +0200 Subject: [PATCH] porting: Update targets and updating script We need to update pkg names to represent at path to the targets. Also update the update_generated_files.sh script to refer to the targets using a path. This is required after recent change to Newt. --- porting/targets/linux/pkg.yml | 2 +- porting/targets/linux_blemesh/pkg.yml | 2 +- porting/targets/porting_default/pkg.yml | 2 +- porting/targets/riot/pkg.yml | 2 +- porting/update_generated_files.sh | 9 +++++++-- 5 files changed, 11 insertions(+), 6 deletions(-) diff --git a/porting/targets/linux/pkg.yml b/porting/targets/linux/pkg.yml index f1159d4a6..c819a83c1 100644 --- a/porting/targets/linux/pkg.yml +++ b/porting/targets/linux/pkg.yml @@ -16,7 +16,7 @@ # under the License. # -pkg.name: "targets/linux" +pkg.name: "porting/targets/linux" pkg.type: "target" pkg.description: This target is used to generate syscfg.h file and other artifacts for linux example app. pkg.author: diff --git a/porting/targets/linux_blemesh/pkg.yml b/porting/targets/linux_blemesh/pkg.yml index c31493333..3cbe09a4b 100644 --- a/porting/targets/linux_blemesh/pkg.yml +++ b/porting/targets/linux_blemesh/pkg.yml @@ -16,7 +16,7 @@ # under the License. # -pkg.name: "targets/linux_blemesh" +pkg.name: "porting/targets/linux_blemesh" pkg.type: "target" pkg.description: This target is used to generate syscfg.h file and other artifacts for linux_blemesh example app. pkg.author: diff --git a/porting/targets/porting_default/pkg.yml b/porting/targets/porting_default/pkg.yml index f7319c254..44a34ba09 100644 --- a/porting/targets/porting_default/pkg.yml +++ b/porting/targets/porting_default/pkg.yml @@ -16,7 +16,7 @@ # under the License. # -pkg.name: "targets/porting_default" +pkg.name: "porting/targets/porting_default" pkg.type: "target" pkg.description: This target is used to generate syscfg.h file and other artifacts for default Nimble port includes. pkg.author: diff --git a/porting/targets/riot/pkg.yml b/porting/targets/riot/pkg.yml index b6610c308..7d1a3243b 100644 --- a/porting/targets/riot/pkg.yml +++ b/porting/targets/riot/pkg.yml @@ -16,7 +16,7 @@ # under the License. # -pkg.name: "targets/riot" +pkg.name: "porting/targets/riot" pkg.type: "target" pkg.description: This target is used to generate syscfg.h file and other artifacts for RIOT Nimble port. pkg.author: diff --git a/porting/update_generated_files.sh b/porting/update_generated_files.sh index c01dddd25..7ede02c9d 100755 --- a/porting/update_generated_files.sh +++ b/porting/update_generated_files.sh @@ -31,6 +31,11 @@ declare -A targets=( for target in "${!targets[@]}"; do echo "Updating target $target" - newt build "$target" > /dev/null 2>&1 - cp "bin/@apache-mynewt-nimble/targets/${target}/generated/include" "${targets[$target]}" -r + newt build "@apache-mynewt-nimble/porting/targets/$target" > /dev/null 2>&1 + cp "bin/@apache-mynewt-nimble/porting/targets/${target}/generated/include" "${targets[$target]}" -r + # Remove repo version and hash MYNEWT_VALS as it doesn't make much sense to commit them and they + # defeat the purpose of this script. + find "${targets[$target]}/include" -type f -name 'syscfg.h' -exec sed -i '/MYNEWT_VAL_REPO_*/,/#endif/d' {} \; + find "${targets[$target]}/include" -type f -name 'syscfg.h' -exec sed -i '/\/\*\*\* Repository/,/\*\//d' {} \; + find "${targets[$target]}/include" -type f -name 'syscfg.h' -exec sed -i '$!N;/^\n$/{$q;D;};P;D;' {} \; done