Created
November 7, 2014 08:07
-
-
Save furushchev/029df209cea03826349a to your computer and use it in GitHub Desktop.
ROS Package Reverter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
function abort() { | |
echo "error: $1" | |
echo "abort..." | |
exit 1 | |
} | |
# find ws root | |
PKGPATHS=`rospack list | grep src` | |
if [ $PKGPATHS = "" ]; then | |
abort "could not found catkin workspace. check ROS_PACKAGE_PATH" | |
fi | |
PKGS=`echo $PKGPATHS | cut -d ' ' -f1` | |
BRANCH_CANDIDATES="$ROS_DISTRO-devel master develop" | |
for PKG in $PKGS; do | |
for BRANCH in $BRANCH_CANDIDATES; do | |
CURRENT_BRANCH=$(git branch | sed -n -e 's/^\* \(.*\)/\1/p') | |
git checkout $BRANCH | |
if [ $? -ne 1 ]; then | |
echo "package $PKG changed $CURRENT_BRANCH -> $BRANCH" | |
break | |
fi | |
done | |
done | |
echo 'All package are now ready to `wstool up`' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment