Skip to content
Snippets Groups Projects
Commit dc9846fc authored by Joaquim Casals Buñuel's avatar Joaquim Casals Buñuel
Browse files

Scripts

parent 6270c258
No related branches found
No related tags found
1 merge request!260WIP: params autoconf
This commit is part of merge request !260. Comments created here will be created in the context of that merge request.
#!/bin/bash
for folder in capture constraint core examples feature landmark processor sensor; do
# out=$(find ~/workspace/wip/wolf/src/$folder -type f | rev | cut -d '/' -f 1 | rev)
out=$(find ~/workspace/wip/wolf/src/$folder -type f)
for file in $out; do
for prefix in capture constraint core feature landmark processor sensor; do
if [ "$folder" == "$prefix" ]; then
sed -i -E "s@(#include[[:space:]]+\")\.\./include/"$prefix/"(.*)\"@\1\2\"@gp" $file
# echo +====================== $file ==================================
# sed -n -E "s@(#include[[:space:]]+\")\.\./include/"$prefix/"(.*)\"@\1\2\"@gp" $file
# echo -===============================================================
fi
done
done
done
for folder in capture constraint core examples feature landmark processor sensor; do
out=$(find ~/workspace/wip/wolf/src/$folder -type f)
for file in $out; do
f=$(echo $file | rev | cut -d '/' -f 1 | rev)
mv $file ~/workspace/wip/wolf/src/$folder/$f
# echo $file " -----> "~/workspace/wip/wolf/src/$folder/$f
sed -i -E "s:.*"$f"$:"$folder/$f":p" ~/workspace/wip/wolf/src/CMakeLists.txt
done
done
\ No newline at end of file
#!/bin/bash
# First parameter $1 is the path to the wolf root
# Second parameter $2 is the name of the new folder
hdrs_folder=$1/include/base/$2
srcs_folder=$1/src/$2
#Fix the includes in general
core_headers=$(ag -g .*\\.h -l $1/include/base/$2/ | rev | cut -d '/' -f 1 | rev)
for f in $core_headers; do
ch_files=$(ag \#include[[:space:]]+\"\(.*\/\)*"$2/$f"\" $1/include/base/ -l)
for fp in $ch_files; do
# echo ".h -> "$fp
sed -i -E "s/(#include[[:space:]]+\")("$2"\/)?"$f"\"/\1base\/"$2"\/"$f"\"/gp" $fp
sed -i -E "s/(#include[[:space:]]+<)("$2"\/)?"$f">/\1base\/"$2"\/"$f">/gp" $fp
done
cs_files=$(ag \#include[[:space:]]+\"\(.*\/\)*"$2/$f"\" $1/src/ -l)
for fp in $cs_files; do
# echo ".cpp -> "$fp
sed -i -E "s/(#include[[:space:]]+\")("$2"\/)?"$f"\"/\1base\/"$2"\/"$f"\"/gp" $fp
sed -i -E "s/(#include[[:space:]]+<)("$2"\/)?"$f">/\1base\/"$2"\/"$f">/gp" $fp
done
done
\ No newline at end of file
wolf_scripts/out 0 → 100644
+ 515
0
View file @ dc9846fc
This diff is collapsed.
source diff could not be displayed: it is too large. Options to address this: view the blob.
#!/bin/bash
for folder in capture core constraint feature internal landmark processor sensor temp ; do
./include_refactor.sh ~/workspace/wip/wolf $folder
done
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment