Created
August 15, 2012 15:33
-
-
Save fingolfin/3361049 to your computer and use it in GitHub Desktop.
Small shell script to update GAP repos as well as any package repositories
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/sh | |
HG_DIRS=". doc/DevManual" | |
GIT_DIRS= | |
# Find packages using Mercurial, if any | |
for pkg in pkg/*/.hg ; do | |
if [ $pkg = "pkg/*/.hg" ] ; then | |
break | |
fi | |
HG_DIRS="$HG_DIRS `dirname $pkg`" | |
done | |
# Find packages using git, if any | |
for pkg in pkg/*/.git ; do | |
if [ $pkg = "pkg/*/.git" ] ; then | |
break | |
fi | |
GIT_DIRS="$GIT_DIRS `dirname $pkg`" | |
done | |
echo HG_DIRS: $HG_DIRS | |
echo GIT_DIRS: $GIT_DIRS | |
for repo in $HG_DIRS ; do | |
echo "/------------------------" | |
echo "Updating $repo" | |
pushd $repo > /dev/null | |
hg pull -u | |
popd > /dev/null | |
echo "\------------------------" | |
done | |
for repo in $GIT_DIRS ; do | |
echo "/------------------------" | |
echo "Updating $repo" | |
pushd $repo > /dev/null | |
git pull | |
popd > /dev/null | |
echo "\------------------------" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment