-
Notifications
You must be signed in to change notification settings - Fork 198
/
Copy pathc_repositories.bash
executable file
·82 lines (68 loc) · 2.39 KB
/
c_repositories.bash
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#!/usr/bin/env bash
echo "####################################################################################################"
echo "##### Cloning git repositories..."
echo "####################################################################################################"
catkin_ws_path=${1:-"$HOME/catkin_ws_drl"}
repositories=${2:-$(cat <<-END
https://github.com/carlosmccosta|dynamic_robot_localization
https://github.com/carlosmccosta|pose_to_tf_publisher
https://github.com/carlosmccosta|laserscan_to_pointcloud
https://github.com/carlosmccosta|mesh_to_pointcloud
https://github.com/carlosmccosta|pcl
https://github.com/ros-perception|pcl_msgs
https://github.com/ros-perception|perception_pcl
END
)
}
cd "${catkin_ws_path}/src/" &> /dev/null
if [ $? -ne 0 ]; then
mkdir -p "${catkin_ws_path}/src"
cd "${catkin_ws_path}/src/"
fi
ls "${catkin_ws_path}/src/.rosinstall" &> /dev/null
if [ $? -ne 0 ]; then
wstool init
fi
for git_repository in ${repositories}
do
IFS="|"; set -- ${git_repository};
git_repository_url="${1}/${2}.git"
ls "${2}" &> /dev/null
if [ $? -ne 0 ]; then
echo -e "\n\n"
echo "-------------------------------------------"
echo "==> Cloning ${2} from ${git_repository_url}"
git clone ${git_repository_url}
else
echo -e "\n\n"
echo "-------------------------------------------"
echo "==> Updating ${2}"
cd ${2}
git pull
cd ..
fi
wstool info "${2}" &> /dev/null
if [ $? -ne 0 ]; then
wstool set "${2}" "${git_repository_url}" --git -y
fi
done
cd "${catkin_ws_path}/src/pcl_msgs"
git checkout noetic-devel
cd "${catkin_ws_path}/src/perception_pcl"
git checkout melodic-devel
cd "${catkin_ws_path}"
find ./src -name "*.bash" -exec chmod +x {} \;
find ./src -name "*.cfg" -exec chmod +x {} \;
find ./src -name "*.sh" -exec chmod +x {} \;
echo -e "\n\n"
echo "----------------------------------------------------------------------------------------------------"
echo ">>>>> Cloning git repositories finished"
echo ">>>>> For updating each git repository use: git pull"
echo ">>>>> For updating all repositories use:"
echo ">>>>> ${catkin_ws_path}/src/dynamic_robot_localization/install/repositories_update.sh"
echo ">>>>> or"
echo ">>>>> cd ${catkin_ws_path}/src"
echo ">>>>> wstool status"
echo ">>>>> Commit or stash modified files"
echo ">>>>> wstool update"
echo "----------------------------------------------------------------------------------------------------"