Skip to content

Instantly share code, notes, and snippets.

@drdanz
Last active April 14, 2019 22:01
Show Gist options
  • Save drdanz/fec6abb0b9f34fd819ef59eeae9476d3 to your computer and use it in GitHub Desktop.
Save drdanz/fec6abb0b9f34fd819ef59eeae9476d3 to your computer and use it in GitHub Desktop.
#!/bin/sh
# for repo in $(~/Workspace/iit/src/robotology.github.io/scripts/list-all-repos.py); do
rm -f out.txt
for repo in $(cat ../vvv-repo-list.txt); do
echo "REPO: $repo"
dir=$(echo $repo | sed 's|git@github.com:vvv-school/\(.\+\)\.git|\1|')
echo "DIR: $dir"
if [ ! -d $dir ]; then
echo " directory does not exist"
git clone -q $repo $dir
else
echo " directory exists"
fi
cd $dir
git branch -a | grep -q "remotes/origin/devel$"
if [ $? -ne 0 ]; then
branch=master
else
branch=devel
fi
echo "BASE BRANCH: $branch"
git checkout $branch
git fetch -q
git reset --hard origin/$branch
git grep -q -iI [^o]RTF
if [ $? -ne 0 ]; then
echo " nothing to do"
else
git branch -q -f robottestingframework-2 $branch
git checkout -q robottestingframework-2
git grep -l "find_package(RTF [0-9.]*" | xargs sed -i 's/find_package(RTF [0-9.]* \?/find_package(RobotTestingFramework 1.6.51 /g' || true
git grep -l "find_package(YARP [0-9.]*" | xargs sed -i 's/find_package(YARP [0-9.]* \?/find_package(YARP 3.1.101 /g' || true
git grep -l "find_package(YARP.\+rtf" | xargs sed -i 's/find_package(YARP\(.\+\)rtf\(.\+\)/find_package(YARP\1robottestingframework\2/g' || true
git grep -l "COMPONENTS.\+rtf" | xargs sed -i 's/COMPONENTS\(.\+\)rtf\(.\+\)/COMPONENTS\1robottestingframework\2/g' || true
git grep -l "RTF_LIBRARIES" | xargs sed -i 's/RTF_LIBRARIES/RobotTestingFramework_LIBRARIES/g' || true
git grep -l "RTF_INCLUDE_DIRS" | xargs sed -i 's/RTF_INCLUDE_DIRS/RobotTestingFramework_INCLUDE_DIRS/g' || true
git grep -l "^PREPARE_PLUGIN" | xargs sed -i 's/^PREPARE_PLUGIN/ROBOTTESTINGFRAMEWORK_PREPARE_PLUGIN/g' || true
git grep -l "^PREPARE_FIXTURE_PLUGIN" | xargs sed -i 's/^PREPARE_FIXTURE_PLUGIN/ROBOTTESTINGFRAMEWORK_PREPARE_FIXTURE_PLUGIN/g' || true
git grep -l "RTF_ASSERT" | xargs sed -i 's/RTF_ASSERT/ROBOTTESTINGFRAMEWORK_ASSERT/g' || true
git grep -l "RTF_TEST" | xargs sed -i 's/RTF_TEST/ROBOTTESTINGFRAMEWORK_TEST/g' || true
git grep -l "RTF_SOURCE" | xargs sed -i 's/RTF_SOURCE/ROBOTTESTINGFRAMEWORK_SOURCE/g' || true
git grep -l "yarp::rtf" | xargs sed -i 's/yarp::rtf/yarp::robottestingframework/g' || true
git grep -l "yarp/rtf" | xargs sed -i 's|yarp/rtf|yarp/robottestingframework|g' || true
git grep -l "<rtf/" | xargs sed -i 's|<rtf/|<robottestingframework/|g' || true
git grep -l "namespace RTF" | xargs sed -i 's/namespace RTF/namespace robottestingframework/g' || true
git grep -l "RTF::" | xargs sed -i 's/RTF::/robottestingframework::/g' || true
git grep -l "YARP::YARP_rtf" | xargs sed -i 's/YARP::YARP_rtf/YARP::YARP_robottestingframework/g' || true
if [ -f CMakeLists.txt ]; then
rm -Rf build
mkdir build
cd build
cmake .. || exit 1
make || exit 1
cd ..
rm -Rf build
rm -Rf gmon.out
fi
git grep -q -iI [^o]RTF
if [ $? -eq 0 ]; then
echo "DID NOT CATCH ALL RTF OCCURRENCES"
git grep -iI [^o]RTF
exit 1
fi
git commit -a -m "Port to RobotTestingFramework 2 and YARP 3.2"
git push --force-with-lease origin robottestingframework-2
echo "https://github.com/vvv-school/$dir/tree/robottestingframework-2" >> ../out.txt
fi
cd ..
echo "-----------------------------------------------------------------------"
done
git@github.com:vvv-school/assignment_closest-blob.git
git@github.com:vvv-school/assignment_codec.git
git@github.com:vvv-school/assignment_collatz-conjecture.git
git@github.com:vvv-school/assignment_computed-torque.git
git@github.com:vvv-school/assignment_computed-torque-simulink.git
git@github.com:vvv-school/assignment_control-pid.git
git@github.com:vvv-school/assignment_dl-tuning.git
git@github.com:vvv-school/assignment_event-orientation-filter.git
git@github.com:vvv-school/assignment_event-saccadic-suppression.git
git@github.com:vvv-school/assignment_event-saliency-map.git
git@github.com:vvv-school/assignment_event-spiking-attention.git
git@github.com:vvv-school/assignment_event-spiking-model.git
git@github.com:vvv-school/assignment_git.git
git@github.com:vvv-school/assignment_grasp-it.git
git@github.com:vvv-school/assignment_inverse-kinematics.git
git@github.com:vvv-school/assignment_make-it-roll.git
git@github.com:vvv-school/assignment_motor-control.git
git@github.com:vvv-school/assignment_producer-consumer.git
git@github.com:vvv-school/assignment_solve-maze.git
git@github.com:vvv-school/assignment_yarp-find-rgb.git
git@github.com:vvv-school/material_yarp.git
git@github.com:vvv-school/submission_instructions.git
git@github.com:vvv-school/template_vvvyy-course.github.io.git
git@github.com:vvv-school/tutorial_cartesian-interface.git
git@github.com:vvv-school/tutorial_dl-deployment.git
git@github.com:vvv-school/tutorial_dl-tuning.git
git@github.com:vvv-school/tutorial_event-driven-flow.git
git@github.com:vvv-school/tutorial_event-driven-framework.git
git@github.com:vvv-school/tutorial_event-handling.git
git@github.com:vvv-school/tutorial_find-wally.git
git@github.com:vvv-school/tutorial_gaze-interface.git
git@github.com:vvv-school/tutorial_impedance-control.git
git@github.com:vvv-school/tutorial_impedance-control-simulink.git
git@github.com:vvv-school/tutorial_inverse-kinematics.git
git@github.com:vvv-school/tutorial_joint-interface.git
git@github.com:vvv-school/tutorial_RFModule.git
git@github.com:vvv-school/tutorial_RFModule-simple.git
git@github.com:vvv-school/tutorial_ros.git
git@github.com:vvv-school/tutorial_wb-toolbox-gazebo-pendulum.git
git@github.com:vvv-school/tutorial_yarp-basics.git
git@github.com:vvv-school/tutorial_yarp-idl.git
git@github.com:vvv-school/tutorial_yarp-multithreading.git
git@github.com:vvv-school/tutorial_yarp-opencv.git
git@github.com:vvv-school/tutorial_yarp-ports.git
git@github.com:vvv-school/tutorial_yarp-producer-consumer.git
git@github.com:vvv-school/tutorial_yarp-rpc.git
git@github.com:vvv-school/tutorial_yarpmanager.git
git@github.com:vvv-school/vvv-school.github.io.git
git@github.com:vvv-school/vvv17.git
git@github.com:vvv-school/vvv17-demo-team-blue.git
git@github.com:vvv-school/vvv17-demo-team-green.git
git@github.com:vvv-school/vvv17-demo-team-orange.git
git@github.com:vvv-school/vvv18.git
git@github.com:vvv-school/vvv18-demo-team-blue.git
git@github.com:vvv-school/vvv18-demo-team-green.git
git@github.com:vvv-school/vvv18-demo-team-orange.git
@pattacini
Copy link

pattacini commented Apr 14, 2019

Hi @drdanz

The file containing the list of the repositories needs to be amended in order to include also those repos solution_* that are private in the organization vvv-school.

Here's below the complete list:

solution_make-it-roll
assignment_collatz-conjecture
solution_collatz-conjecture
assignment_make-it-roll
vvv-school.github.io
vvv17
tutorial_cartesian-interface
tutorial_gaze-interface
tutorial_yarp-ports
tutorial_yarp-rpc
tutorial_RFModule
tutorial_yarp-multithreading
tutorial_yarp-idl
assignment_producer-consumer
tutorial_impedance-control
assignment_computed-torque
template_vvvyy-course.github.io
solution_producer-consumer
tutorial_event-driven-flow
tutorial_impedance-control-simulink
tutorial_joint-interface
solution_computed-torque
material_yarp
solution_event-spiking-model
solution_computed-torque-simulink
assignment_computed-torque-simulink
solution_grasp-it
assignment_grasp-it
assignment_git
tutorial_yarpmanager
solution_event-orientation-filter
solution_event-saliency-map
tutorial_find-wally
tutorial_yarp-opencv
solution_closest-blob
assignment_closest-blob
tutorial_dl-tuning
material_kinematics
assignment_event-spiking-model
solution_codec
assignment_event-orientation-filter
assignment_codec
material_dynamics
assignment_dl-tuning
solution_dl-tuning
material_deep-learning
assignment_event-saliency-map
tutorial_event-handling
vvv17-demo-team-orange
vvv17-demo-team-blue
vvv17-demo-team-green
solution_control-pid
assignment_control-pid
vvv18
solution_yarp-find-rgb
assignment_yarp-find-rgb
tutorial_yarp-basics
material_school
submission_instructions
assignment_solve-maze
solution_event-saccadic-suppression
tutorial_inverse-kinematics
solution_inverse-kinematics
assignment_inverse-kinematics
tutorial_event-driven-framework
tutorial_RFModule-simple
solution_motor-control
assignment_motor-control
solution_event-spiking-attention
tutorial_yarp-producer-consumer
tutorial_ros
tutorial_dl-deployment
assignment_event-saccadic-suppression
assignment_event-spiking-attention
vvv18-demo-team-green
vvv18-demo-team-orange
vvv18-demo-team-blue
tutorial_wb-toolbox-gazebo-pendulum

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment