Skip to content

Instantly share code, notes, and snippets.

@fingolfin
Created August 15, 2012 15:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fingolfin/3361049 to your computer and use it in GitHub Desktop.
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
#!/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